Created
May 1, 2012 14:43
-
-
Save clawfire/2568427 to your computer and use it in GitHub Desktop.
New .htaccess for PancakeApp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Options +FollowSymlinks | |
RewriteEngine on | |
# On Rackspace and getting 404's? Uncoment this by removing the # : | |
# RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
<IfModule mod_rewrite.c> | |
RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L] | |
</IfModule> | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php?/$1 [L] | |
################################################ | |
# Caching and optimizing the speed of Pancake. # | |
################################################ | |
<IfModule mod_headers.c> | |
Header unset ETag | |
</IfModule> | |
FileETag None | |
<IfModule mod_deflate.c> | |
# Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/ | |
<IfModule mod_setenvif.c> | |
<IfModule mod_headers.c> | |
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding | |
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding | |
</IfModule> | |
</IfModule> | |
# HTML, TXT, CSS, JavaScript, JSON, XML, HTC: | |
<IfModule filter_module> | |
<IfModule version.c> | |
<IfVersion >= 2.4> | |
FilterDeclare COMPRESS | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'text/html'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'text/css'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'text/plain'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'text/xml'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'text/x-component'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'application/javascript'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'application/json'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'application/xml'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'application/xhtml+xml'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'application/rss+xml'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'application/atom+xml'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'application/vnd.ms-fontobject'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'image/svg+xml'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'image/x-icon'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'application/x-font-ttf'" | |
FilterProvider COMPRESS DEFLATE "%{CONTENT_TYPE} = 'font/opentype'" | |
FilterChain COMPRESS | |
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no | |
</IfVersion> | |
<IfVersion <= 2.2> | |
FilterDeclare COMPRESS | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $image/x-icon | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype | |
FilterChain COMPRESS | |
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no | |
</IfVersion> | |
</IfModule> | |
<IfModule !version.c> | |
FilterDeclare COMPRESS | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/vnd.ms-fontobject | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $image/x-icon | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf | |
FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype | |
FilterChain COMPRESS | |
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no | |
</IfModule> | |
</IfModule> | |
<IfModule !mod_filter.c> | |
# Legacy versions of Apache | |
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component | |
AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml | |
AddOutputFilterByType DEFLATE image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype | |
</IfModule> | |
</IfModule> | |
<IfModule mod_expires.c> | |
ExpiresActive on | |
# Perhaps better to whitelist expires rules? Perhaps. | |
ExpiresDefault "access plus 1 month" | |
ExpiresByType text/cache-manifest "access plus 0 seconds" | |
ExpiresByType text/html "access plus 0 seconds" | |
ExpiresByType text/xml "access plus 0 seconds" | |
ExpiresByType application/xml "access plus 0 seconds" | |
ExpiresByType application/json "access plus 0 seconds" | |
ExpiresByType application/rss+xml "access plus 1 hour" | |
ExpiresByType application/atom+xml "access plus 1 hour" | |
ExpiresByType image/x-icon "access plus 1 year" | |
ExpiresByType image/gif "access plus 1 year" | |
ExpiresByType image/png "access plus 1 year" | |
ExpiresByType image/jpg "access plus 1 year" | |
ExpiresByType image/jpeg "access plus 1 year" | |
ExpiresByType text/x-component "access plus 1 year" | |
ExpiresByType text/css "access plus 1 year" | |
ExpiresByType application/javascript "access plus 1 year" | |
<IfModule mod_headers.c> | |
Header append Cache-Control "public" | |
</IfModule> | |
</IfModule> | |
AddDefaultCharset utf-8 | |
AddCharset utf-8 .html .css .js .xml .json .rss .atom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment