Skip to content

Instantly share code, notes, and snippets.

@alch
Last active December 29, 2015 08:49
Show Gist options
  • Save alch/7646255 to your computer and use it in GitHub Desktop.
Save alch/7646255 to your computer and use it in GitHub Desktop.
Symfony assets cache bust
<IfModule mod_rewrite.c>
RewriteEngine On
# cache-bust assets url rewrite
# URL substitution example:
# http://example.com/v1/js/3785f80.js -> http://example.com/js/3785f80.js
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^v\d+\/(.+)$ $1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment