mod_rewrite filename from mod_pagespeed back to normal files

Posted by British Sea Turtle on Super User See other posts from Super User or by British Sea Turtle
Published on 2013-11-10T01:39:00Z Indexed on 2013/11/10 22:03 UTC
Read the original article Hit count: 219

Filed under:
|
|

I am hoping someone can help me with this problem. I am moving to a new server and not using mod_pagespeed any more. However we have lots of external links to images on our site using the strange mod_pagespeed filenames. This is not an issue but we do not want to have lots of 404 errors.

So I have lots of links like the following :

http://www.domain.com/images/150x150xlink.png.pagespeed.ic.pPXw45HSQm.png
http://www.domain.com/images/paris_01.gif.pagespeed.ce.vfrkuKUaj0.gif
http://www.doamin.com/images/1st2.gif.pagespeed.ce.OUg38q6VbZ.gif

How can I redirect them to :

http://www.domain.com/images/150x150xlink.png
http://www.domain.com/images/paris_01.gif
http://www.doamin.com/images/1st2.gif

There are thousands of files like this so I am hoping for a simple solution with mod_rewrite, I tried this but it does not work. So any help would be appreciated.

RewriteCond %{REQUEST_URI} \.gif\.pagespeed\. [NC]
RewriteRule ^(.*?\.gif)\..*\.gif$ $1 [NC,L]

© Super User or respective owner

Related posts about linux

Related posts about apache2