Monday, February 21, 2011

Another .htaccess Question about redirects

I want to redirect /forums/uploads/profile/photo-thumb-[RANDOMNUMBER].jpg

to a static no photo file like: /forums/uploads/profile/photo-thumb-none.jpg

I know it can be done with .htaccess I am currently experiencing lots of 404 Errors.

Thanks

From stackoverflow
  • You need a RegEx for this. So that any request that matches that regular expression will be redirected to the other file.
    So try this:RewriteRule /forums/uploads/profile/photo-thumb-[0-9]*.jpg /forums/uploads/profile/photo-thumb-none.jpg

0 comments:

Post a Comment