JoeAnzalone/Photog.io/master/.htaccess - Htaccess File

JoeAnzalone/Photog.io/master/.htaccess

RewriteEngine on

# http://stackoverflow.com/a/9963676
# Forces a trailing slash to be added
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.[a-zA-Z0-9]{1,5}|/)$
RewriteCond %{REQUEST_METHOD} !POST
RewriteRule (.*)$ /$1/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php?$0 [PT,L]

# ************ Caching *******************
# http://stackoverflow.com/a/7337896
# Make stuff cacheable
ExpiresActive On
ExpiresDefault "access plus 1 week"

# Typically dynamic PHP content
ExpiresByType text/html "access plus 0 seconds"

# PDF files don't need to be cached either
ExpiresByType application/pdf "access plus 0 seconds"
ExpiresByType application/atom+xml "access plus 0 seconds"

# ****************************************

# http://www.samaxes.com/2008/04/htaccess-gzip-and-cache-your-site-for-faster-loading-and-bandwidth-saving/
<ifModule mod_gzip.c>
  mod_gzip_on Yes
  mod_gzip_dechunk Yes
  mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
  mod_gzip_item_include handler ^cgi-script$
  mod_gzip_item_include mime ^text/.*
  mod_gzip_item_include mime ^application/x-javascript.*
  mod_gzip_item_exclude mime ^image/.*
  mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

# http://www.sevenpixels.com/tips/
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/css text/javascript application/x-javascript application/javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
</IfModule>

On Github License

Files

Download PDF of Htaccess file
DEFLATE, POST, REQUEST_FILENAME, REQUEST_METHOD, REQUEST_URI

Comments

Apache