Created
May 8, 2015 17:11
-
-
Save klaytonfaria/6e2544eae7d44f216fab to your computer and use it in GitHub Desktop.
.htacces conf
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
#####cache | |
ExpiresActive On | |
ExpiresByType image/gif "access plus 6 months" | |
ExpiresByType image/jpeg "access plus 6 months" | |
ExpiresByType image/png "access plus 6 months" | |
ExpiresByType text/css "access plus 6 months" | |
ExpiresByType text/javascript "access plus 6 months" | |
ExpiresByType application/javascript "access plus 6 months" | |
######gzip | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/css | |
AddOutputFilterByType DEFLATE application/javascript | |
#####Rewriting | |
#Removing .html | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^([^\.]+)$ $1.html [NC,L] | |
#Removing .html using / | |
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.html | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$ | |
RewriteRule (.*)$ /$1/ [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment