Htaccess File


<IfModule mod_headers.c>
# 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

# gzip compression.
<IfModule mod_deflate.c>

  # html, txt, css, js, json, xml, htc:
  AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
  AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript
  AddOutputFilterByType DEFLATE text/xml application/xml text/x-component

  # webfonts and svg:
  <FilesMatch ".(ttf|otf|eot|svg)$" >
    SetOutputFilter DEFLATE

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^
  RewriteRule (.*)$1 [R=301,L]

# Proper svg serving. Required for svg webfonts on iPad
AddType     image/svg+xml              svg svgz
AddEncoding gzip                       svgz

# webfonts
AddType application/  eot
AddType font/truetype                  ttf
AddType font/opentype                  otf
AddType font/woff                      woff

# without -MultiViews, Apache will give a 404 for a rewrite if a folder of the same name does not exist
#   e.g. /blog/hello :
Options -MultiViews
# -Indexes will have Apache block users from browsing folders without a default document
Options -Indexes
# custom 404 page
ErrorDocument 404 /404.html
# use utf-8 encoding for anything served text/plain or text/html
AddDefaultCharset utf-8
# force utf-8 for a number of file formats
AddCharset utf-8 .html .css .js .xml .json .rss
# We don't need to tell everyone we're apache.
ServerSignature Off
Exit mobile version