apache: rewrite js remove timestamp

well, i would like to rewrites js:

/resources/js/general.js/1234/ -> /resources/js/general.js

due to akamai’s cache i can’t use regular querystring: ?t=1234

static works:

RewriteRule ^(.*).js/[0-9]+/$ /resources/js/general.js [NC,L]

but i can’t build a dynamic regex 🙁

RewriteRule ^(.*).js/[0-9]+/$ $1 [NC,L] ->  /resources/js/general

well, but:

RewriteRule ^(.*).js/[0-9]+/$ $1.js [NC,L] -> /resources/js/general.js/1234/

and:

RewriteRule ^(.*).js/[0-9]+/$ $1.js [NC,L] -> /resources/js/general.js/1234/

thank you 🙂


Source: apache

Leave a Reply