jhauraw/trailability.com/master/.htaccess - Htaccess File

jhauraw/trailability.com/master/.htaccess

---
layout: nil
---

Options -Indexes
IndexIgnore *

ErrorDocument 404 {{ '/404.html' | to_baseurl }}
ErrorDocument 500 {{ '/500.html' | to_baseurl }}

# Redirects ============================================================ */

# Redirect 301 /URL/ http://{{ site.app.domain }}/URL/

# END ================================================================== */

# Webfonts for CDN, cross-domain policy
AddType application/vnd.ms-fontobject .eot
AddType font/truetype .ttf
AddType font/opentype .otf
AddType font/opentype .woff
AddType image/svg+xml .svg .svgz
AddEncoding gzip .svgz

<FilesMatch ".(ttf|otf|eot|woff|svg)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
  </IfModule>
</FilesMatch>

<IfModule mod_expires.c>
  Header unset Pragma
  FileETag none
  Header unset ETag

  ExpiresActive on

  # Expires and Cache Control max-age for HTML
  <FilesMatch "(.*).(html)$">
    ExpiresDefault "access plus 60 seconds"
    Header set Cache-Control "max-age=60, public"
    Header unset Last-Modified
  </FilesMatch>

  # Expires and Cache Control max-age for ASSETS/MEDIA CDN
  <FilesMatch "(.*).(ico|jpg|jpeg|png|gif|js|css|swf|svg|ttf|otf|woff)$">
    ExpiresDefault "access plus 1 year"
    Header set Cache-Control "max-age=31536000, public"
    Header unset Last-Modified
  </FilesMatch>
</IfModule>

# GZIP
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {{ '/' | to_baseurl }}

# CDN Virtual Versioned URLs
RewriteRule ^v[0-9]{6,6}/(.*)$ /$1 [L]

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

# index.html to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /.*index.html HTTP/
RewriteRule ^(.*)index.html$ /$1 [R=301,QSA,L]
</IfModule>

On Github License

Files

Download PDF of Htaccess file
DEFLATE, HTTP_HOST, Pragma, THE_REQUEST

Comments

Apache