Possible Duplicate:
Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask?

sometimes my drupal site add extra string to image url which causes the image to be broken. the url is


what is the needed rewrite rule to strip the bolded (%252F) part in the above link
ie. to be:


I have tried this, but didn't work

RewriteCond %{QUERY_STRING} ^(.*)\%252Fsites(.*)$
RewriteRule %{REQUEST_URI}  %1sites%2

You should try this rewrite rule to replace/strip.

RewriteRule ^(.*)[%252F](.*)$ $1$2 [N]

Are you sure it's a bug in Drupal? The last comment of the bug report you linked to says this:

If you are using custom code, please remove the leading / in your image path.

  • this is if you are using custom code... but in my case i am using VIEWS module which is for drupal itself – Alaa Alomari Nov 30 '12 at 16:12

I think it should be

RewriteRule ^(.*)%2Fsites(.*)$ $1sites$2 [L,R=301,NC]

Not the answer you're looking for? Browse other questions tagged or ask your own question.