Hey there!
I have a folder /staticon the Apache 2.x web server. If the request matches
/static/<somename like [\S-_]+>.(png|jpg|css|js)/\d{8,15}
eg
/static/bg.jpg/1335455634
I want two things:
- url should be rewritten to
/static/bg.jpg(getting rid of timestamps) - it will never expire (expires 2030, max-age = 290304000, shared cache, ...)
If the request does not match, the request and its headers should be as usual, not rewrite. Ideally, any request from outside / static / * should not be affected (although "matching trailing times" should be rare ...)
I have nothing but problems with FilesMatch / RewriteCond, so I prefer not to send my bad attempts ... (Rewrite in genereal is enabled on my machine and I really have the right to send cached headers)
Dankeschön!
source
share