Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# Turn off the ETags
Header unset ETag
FileETag None
# Turn off the Last Modified header except for html docs
Header unset Last-Modified
# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0
# Set up caching on media files for 1 year (forever?)
ExpiresDefault A29030400
Header append Cache-Control "public"
# Set up caching on media files for 1 week
ExpiresDefault A604800
Header append Cache-Control "public"
# Set up 2 Hour caching on commonly updated files
ExpiresDefault A7200
Header append Cache-Control "proxy-revalidate"
# Force no caching for dynamic files
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
# ERROR PAGE
ErrorDocument 404 http://oldschoolgabbers.nl/404.html
ErrorDocument 403 http://oldschoolgabbers.nl/403.html
ErrorDocument 400 http://oldschoolgabbers.nl/400.html
ErrorDocument 401 http://oldschoolgabbers.nl/401.html
ErrorDocument 500 http://oldschoolgabbers.nl/500.html
# No Hotlinking
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?oldschoolgabbers\.nl/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?hardcore.gerelateerd\.nl/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?ogmp3\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?animedawg\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?warezraver\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?animefreakz\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?hardcoregabbers\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://animedawg.com/images/no-hotlinking-oldschoolgabbers.gif [L]
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.*
# 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
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.[0678] no-gzip
BrowserMatch \bMSIE !no-gzip
Header append Vary User-Agent env=!dont-vary
# Cache control is set only if mod_headers is enabled, so that's unncessary to declare
# gzip js
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{REQUEST_FILENAME}.jgz -f
RewriteRule (.*)\.js$ $1\.js.jgz [L]
AddType "text/javascript" .js.jgz
AddEncoding gzip .jgz