Created
June 21, 2012 18:28
-
-
Save wdalmut/2967603 to your computer and use it in GitHub Desktop.
.htaccess useful rules
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
# Rewrite non www urls to www | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^example\.com$ [NC] | |
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] |
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
<VirtualHost *:80> | |
ServerName example.com | |
DocumentRoot /path/to/eg | |
# Write logs to /path/to/eg/rewrite.log | |
RewriteLog rewrite.log | |
# Semi-verbose log | |
RewriteLogLevel 5 | |
# Turn on rewrite and inherit rules | |
RewriteEngine On | |
RewriteOptions Inherit | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment