questrom/formulaic/master/.htaccess - Htaccess File


# See
# and for more information
# about some of these directives.

# Everything is UTF-8
AddDefaultCharset utf-8
AddCharset utf-8 .atom 

# No directory listings (for security)
<IfModule mod_autoindex.c>
  Options -Indexes

# Avoid rewriting issues
Options -MultiViews

# Alter HTTP headers for improved security
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
Header unset X-Powered-By

# Hide Apache somewhat (see html5boilerplate for details)
ServerSignature Off

# GZip settings from html5boilerplate
<IfModule mod_deflate.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)s*,?s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
AddOutputFilterByType DEFLATE "application/atom+xml" 

# Don't let proxies create problems
Header merge Cache-Control "no-transform"

RewriteEngine On
# Rewrite cache-busting urls
RewriteRule ^(.*).hash-.*?.(.*)$ $1.$2 [PT]
# Except for specific (whitelisted) files, rewrite everything to index.php
# for appropriate routing.
RewriteRule !^(styles.css|client.js|lib/.*|img/.*|docs/.*|robots.txt)$ index.php

# Misc. caching settings
FileETag All
Header merge Cache-Control "private"

# For ordinary (noncachebusted) files, set a very short expiration time.
ExpiresActive on
ExpiresDefault "access plus 0 seconds"

# Because we use cachebusting URLs, we can set "expires"
# very far in the future.
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"

On Github License


Download PDF of Htaccess file