Skip to content

Instantly share code, notes, and snippets.

@carmelyne
Created February 19, 2009 03:59
Show Gist options
  • Save carmelyne/66719 to your computer and use it in GitHub Desktop.
Save carmelyne/66719 to your computer and use it in GitHub Desktop.
# If cached file exists, serve it and stop processing
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}%{REQUEST_FILENAME} -f
RewriteRule ^(.*)$ /cache/%{HTTP_HOST}$1 [L]
# other redirection (imgs, js, css, ...)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !.*/mephisto/.*
RewriteCond %{REQUEST_URI} !.*html
RewriteCond %{REQUEST_URI} !^/cache
RewriteCond %{DOCUMENT_ROOT}/cache/%{HTTP_HOST}/$1 -f
RewriteRule ^/(.*)$ /cache/%{HTTP_HOST}/$1 [QSA,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment