Created
February 25, 2014 16:09
-
-
Save ajithrn/9211976 to your computer and use it in GitHub Desktop.
htaccess: prepend www
This file contains hidden or 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
#add www.infront of urls | |
RewriteEngine on | |
RewriteBase / | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteCond %{HTTP_HOST} ^([^.]+\.[a-z]{2,6})$ [NC] | |
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment