Skip to content

Instantly share code, notes, and snippets.

@michaelcontento
Created May 30, 2011 16:02
Show Gist options
  • Save michaelcontento/999081 to your computer and use it in GitHub Desktop.
Save michaelcontento/999081 to your computer and use it in GitHub Desktop.
RewriteRule with md5 cachebusting
RewriteEngine On
# Rewrite all URLs with md5 cachebusting
# e.g. /e0d97534e77671a12012a9a1effc3bda/css/style.css -> /css/style.css
RewriteRule ^[A-Z0-9]{32}/(.*)$ $1 [NC,N]
# Based on the Zend Framework manual
# see: http://framework.zend.com/manual/1.11/en/project-structure.rewrite.html
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment