apache - RewriteRule to remove version number -


i have implemented cache busting solution on site version number added end of file name, before file extension. having issue 1 of rules not working.

typical requests:

/static/deploy/styles/site_78_direct.min.0.css /static/deploy/styles/ie/site_78_direct.0.css 

i need above redirected following:

/static/deploy/styles/site_78_direct.min.css /static/deploy/styles/ie/site_78_direct.css 

i came following half works:

rewriterule ^/static/deploy/styles/ie/(.*).([0-9]+).css$ /static/deploy/styles/ie/$1.css [l] rewriterule ^/static/deploy/(scripts|styles)/(.*).min.([0-9]+).(js|css)$ /static/deploy/$1/$2.min.$4 [l] 

the above redirects want ignore following:

/static/deploy/styles/ie/site_78_direct-blessed1.css 

i want redirect if there number between fullstops, i.e. .0.css

any appreciated.

make sure escape dot otherwise match character.

besides single rule should work both cases:

rewriterule ^(/?static/deploy/.+?)\.\d+\.(js|css)$ $1.$2 [l,nc] 

Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -