Created
March 19, 2012 06:28
-
-
Save fedmich/2098901 to your computer and use it in GitHub Desktop.
HTaccess apache
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
<IfModule mod_expires.c> | |
ExpiresActive On | |
ExpiresDefault "access plus 1 seconds" | |
ExpiresByType image/x-icon "access plus 2692000 seconds" | |
ExpiresByType image/jpeg "access plus 2692000 seconds" | |
ExpiresByType image/png "access plus 2692000 seconds" | |
ExpiresByType image/gif "access plus 2692000 seconds" | |
ExpiresByType application/x-shockwave-flash "access plus 2692000 seconds" | |
ExpiresByType text/css "access plus 2692000 seconds" | |
ExpiresByType text/javascript "access plus 2692000 seconds" | |
ExpiresByType application/x-javascript "access plus 2692000 seconds" | |
ExpiresByType text/html "access plus 600 seconds" | |
ExpiresByType application/xhtml+xml "access plus 600 seconds" | |
</IfModule> | |
<IfModule mod_headers.c> | |
<FilesMatch "\.(ico|jpe?g|png|gif|swf|css|js)$"> | |
Header set Cache-Control "max-age=2692000, public" | |
</FilesMatch> | |
<FilesMatch "\.(x?html?|php)$"> | |
Header set Cache-Control "max-age=600, private, must-revalidate" | |
</FilesMatch> | |
Header unset ETag | |
Header unset Last-Modified | |
</IfModule> | |
#can also use as A = Access time, M = Modified time | |
#ExpiresByType image/jpeg A604800 | |
#ExpiresByType image/jpeg M604800 |
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
#Redirect to noWWW urls | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^fedmich.com$ [NC] | |
RewriteRule ^(.*)$ http://fedmich.com/$1 [L,R=301] |
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
#Redirect to noWWW urls | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^(www.|$) [NC] | |
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTP_USER_AGENT} MSIE | |
RewriteRule ^(restricted/.*)$ /ie-browser-resctricted [R=301,L] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment