sparanoid/sparanoid-stacey/master/.htaccess - Htaccess File

sparanoid/sparanoid-stacey/master/.htaccess

Options -Indexes
Header unset Pragma
FileETag None
Header unset ETag
Header set Vary Accept-Encoding

# no-www.org/faq.php?q=class_b
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# allow access from all domains for webfonts
<FilesMatch ".(ttf|otf|eot|woff|font.css)$">
  <IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "sparanoid.com"
  </IfModule>
</FilesMatch>

# add file types
AddType application/vnd.ms-fontobject eot
AddType font/ttf                      ttf
AddType font/otf                      otf
AddType font/x-woff                   woff
AddType image/svg+xml                 svg svgz 
AddType video/ogg                     ogg ogv
AddType video/mp4                     mp4

# HTML5 cache
# AddType text/cache-manifest manifest

# gzip compression.
<IfModule mod_deflate.c>
  # html, xml, css, and js:
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/json application/atom+xml
  
  # webfonts and svg:
  <FilesMatch ".(ttf|otf|woff|eot|svg|svgz)$" >
    SetOutputFilter DEFLATE
  </FilesMatch>
</IfModule>

# global expires header
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 10 years"
</IfModule>

# 10 years
<FilesMatch ".(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|tff|otf|svg|svgz|eot)$">
  Header set Cache-Control "max-age=315360000"
  Header unset Last-Modified
</FilesMatch>

# 1 year
<FilesMatch ".(html|htm|xml|txt|sh)$">
  Header set Cache-Control "max-age=31536000, must-revalidate"
</FilesMatch>

# custom error pages
ErrorDocument 403 http://sparanoid.com/
ErrorDocument 404 http://sparanoid.com/
ErrorDocument 500 "Error 500"
ErrorDocument 503 "Error 503"

#ErrorDocument 403 /error/403.php
#ErrorDocument 404 /error/404.php
#ErrorDocument 500 /error/500.php
#ErrorDocument 503 /error/503.php

# old posts
Redirect 301 /blog/feed/ http://sparanoid.com/feed/
Redirect 301 /blog http://sparanoid.com
Redirect 302 /lab/7z/archive/ http://code.google.com/p/7-zip/downloads/list
Redirect 301 /4/12-eminem-mockingbird.mp3 http://sparanoid.com/
Redirect 301 /4/06-fort_minor-whered_you_go_(feat._holly_brook_and_jonah_matranga).mp3 http://sparanoid.com/

# from wordpress to stacey
Redirect 301 /artwork/hello-world                        /news/hello-world
Redirect 301 /game/logging-cwow-with-us-client                  /notebook/logging-cwow-with-us-client
Redirect 301 /project/igoogle-theme-somilody-2                  /notebook/igoogle-theme-somilody-2
Redirect 301 /project/7-zip-chinese-simplified-language-file-revision-1      /project/7z-language-revision
Redirect 301 /project/judgment-screensaver-icon-from-academy-city        /project/judgment-screensaver-icon
Redirect 301 /project/angel-beats-girls-dead-monster-logo            /project/angel-beats-and-girls-dead-monster
Redirect 301 /project/lucky-star-skin-qq-sogou-pinyin              /project/lucky-star-ime-theme

# BEGIN Stacey
RewriteEngine on

# Some hosts require a rewritebase rule, if so, uncomment the RewriteBase line below. If you are running from a subdirectory, your rewritebase should match the name of the path to where stacey is stored.
# ie. if in a folder named 'stacey', RewriteBase /stacey
#RewriteBase /

# Rewrite any calls to *.html, *.json, *.xml, *.atom, *.rss, *.rdf or *.txt if a folder matching * exists
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !public/
RewriteCond %{DOCUMENT_ROOT}/public/$1.$2 !-f
RewriteRule (.+).(html|json|xml|atom|rss|rdf|txt)$ $1/ [L]

# Add a trailing slash to directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.)
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ([^/]+)$ $1/ [L]

# Rewrite any calls to /* or /app to the index.php file
RewriteCond %{REQUEST_URI} /app/$
RewriteRule ^app/ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ index.php?$1 [L]

# Rewrite any file calls to the public directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !public/
RewriteRule ^(.+)$ public/$1 [L]

On Github License

Files

Download PDF of Htaccess file
DEFLATE, DOCUMENT_ROOT, HTTP_HOST, Pragma, REQUEST_FILENAME, REQUEST_URI

Comments

Apache