Last active
December 12, 2015 05:19
-
-
Save jayarjo/4721061 to your computer and use it in GitHub Desktop.
redirect non-www to www
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ignore specific path (/administrator/ - in this case) | |
RewriteCond %{REQUEST_URI} ^/?administrator($|\/|\/.*) [NC] | |
RewriteRule ^.*$ - [NC,L] | |
# redirect non-www to www | |
RewriteCond %{HTTP_HOST} ^yoursite\.com [NC] | |
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment