Skip to content

Instantly share code, notes, and snippets.

@tadejm
Created April 22, 2010 07:13
Show Gist options
  • Save tadejm/374912 to your computer and use it in GitHub Desktop.
Save tadejm/374912 to your computer and use it in GitHub Desktop.
Options +FollowSymlinks
Options All -Indexes
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/(robots\.txt|favicon\.ico|sitemap\.xml)$
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain/$1 [R=301,L]
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule ^(([^/]+/)*[^./]+)/?$ /$1.html [L]
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text\.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image\.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
<Files .htaccess>
order allow,deny
deny from all
</Files>
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 15 Apr 2020 20:00:00 GMT"
</FilesMatch>
Header unset ETag
FileETag None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment