Created
July 24, 2013 07:22
-
-
Save anova/6068635 to your computer and use it in GitHub Desktop.
.htaccess for www enforcement and wordpress. (helicon)
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
# BEGIN WordPress | |
RewriteEngine on | |
RewriteBase / | |
#enforce www | |
#http://stackoverflow.com/a/4958847/181295 | |
RewriteCond %{HTTP_HOST} !^$ | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteCond %{HTTPS}s ^on(s)| | |
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
#to use relative paths in RewriteMap, map files must reside in the same folder as .htaccess | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [NC,L,NS] | |
# END WordPress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment