sgnl02/personal-site/master/.htaccess - Htaccess File

sgnl02/personal-site/master/.htaccess

RewriteEngine On

#RewriteCond %{HTTP_HOST} !^stefanjonker.nl$ [NC]
#RewriteRule ^(.*)$ http://stefanjonker.nl/$1 [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html

ErrorDocument 403 /errors/403.html
ErrorDocument 404 /errors/404.html

Header unset Pragma
FileETag None
Header unset ETag

<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
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>

<FilesMatch ".(ico)$">
#Cache for 1 month
#Specified in seconds

Header set Cache-Control "max-age=2419200, public, must-revalidate"
</FilesMatch>

<FilesMatch ".(jpg|jpeg|png|gif)$">
#Cache in the future, because it's revisioned: 
#http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/

ExpiresActive On
ExpiresDefault "access plus 10 years"
</FilesMatch>

<FilesMatch ".(js|css|html|htm|xml|txt|xsl)$">
#Cache for 2 weeks
Header set Cache-Control "max-age=1209600, must-revalidate"
</FilesMatch>

<FilesMatch ".(htm|html|css|js)$">
AddDefaultCharset UTF-8
</FilesMatch>

On Github License

Files

Download PDF of Htaccess file
HTTP_HOST, Pragma, REQUEST_FILENAME

Comments

Apache