BCRM/www/master/hosting/domainfactory/.htaccess - Htaccess File

BCRM/www/master/hosting/domainfactory/.htaccess

############################################
# Options
Options +FollowSymLinks
DirectoryIndex app.php index.php
AddDefaultCharset Off
AddType application/x-httpd-php56 .php

############################################
## Rewrite rules
RewriteEngine On
RewriteBase /

# Force SSL
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

# Outdated links
RewriteRule ^p/Pressespiegel /p/Nachlese [L,R=permanent]

# Symfony 2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ app.php [QSA,L]

############################################
# Encoding - we don't want böses encoding!
AddDefaultCharset "utf-8"

############################################
# Fix FCGI auth 
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

############################################
# Caching

# Force the latest IE version, in various cases when it may fall back to IE7 mode
#  github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
# Because X-UA-Compatible isn't sent to non-IE (to save header bytes),
# We need to inform proxies that content changes based on UA
Header append Vary User-Agent
# Cache control is set only if mod_headers is enabled, so that's unncessary to declare

# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)s,?s(gzip|deflate)?|X{4,13}|~{4,13}|-{4,13})$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding

AddOutputFilterByType DEFLATE "application/atom+xml" 
"application/javascript" 
"application/json" 
"application/ld+json" 
"application/manifest+json" 
"application/rdf+xml" 
"application/rss+xml" 
"application/schema+json" 
"application/vnd.geo+json" 
"application/vnd.ms-fontobject" 
"application/x-font-ttf" 
"application/x-javascript" 
"application/x-web-app-manifest+json" 
"application/xhtml+xml" 
"application/xml" 
"font/eot" 
"font/opentype" 
"image/bmp" 
"image/svg+xml" 
"image/vnd.microsoft.icon" 
"image/x-icon" 
"text/cache-manifest" 
"text/css" 
"text/html" 
"text/javascript" 
"text/plain" 
"text/vcard" 
"text/vnd.rim.location.xloc" 
"text/vtt" 
"text/x-component" 
"text/x-cross-domain-policy" 
"text/xml"

ExpiresActive on

# Perhaps better to whitelist expires rules? Perhaps.
ExpiresDefault                          "access plus 1 month"

# cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5)
ExpiresByType text/cache-manifest       "access plus 0 seconds"

# Your document html
ExpiresByType text/html                 "access plus 0 seconds"

# Data
ExpiresByType text/xml                  "access plus 0 seconds"
ExpiresByType application/xml           "access plus 0 seconds"
ExpiresByType application/json          "access plus 0 seconds"

# RSS feed
ExpiresByType application/rss+xml       "access plus 1 hour"

# Favicon (cannot be renamed)
ExpiresByType image/x-icon              "access plus 1 week"

# Media: images, video, audio
ExpiresByType image/gif                 "access plus 1 month"
ExpiresByType image/png                 "access plus 1 month"
ExpiresByType image/jpg                 "access plus 1 month"
ExpiresByType image/jpeg                "access plus 1 month"
ExpiresByType video/ogg                 "access plus 1 month"
ExpiresByType audio/ogg                 "access plus 1 month"
ExpiresByType video/mp4                 "access plus 1 month"
ExpiresByType video/webm                "access plus 1 month"

# HTC files  (css3pie)
ExpiresByType text/x-component          "access plus 1 month"

# Webfonts
ExpiresByType font/truetype             "access plus 1 month"
ExpiresByType font/opentype             "access plus 1 month"
ExpiresByType application/x-font-woff   "access plus 1 month"
ExpiresByType image/svg+xml             "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"

# CSS and JavaScript
ExpiresByType text/css                  "access plus 1 year"
ExpiresByType application/javascript    "access plus 1 year"
ExpiresByType text/javascript           "access plus 1 year"

# Since we're sending far-future expires, we don't need ETags for
# static content.
#   developer.yahoo.com/performance/rules.html#etags
FileETag None

On Github License

Files

Download PDF of Htaccess file
DEFLATE, HTTPS, REQUEST_FILENAME, SERVER_NAME, static

Comments

Apache