Replace encoded character

i need some help with a problem i have in my htaccess.
many URLs in my site got ‘/%2F’. some even got it more than once.
in some cases, the URLs are url-encoding and looks like this: /%252F’
i need to define a rule to remove it.
i tried:
RewriteRule ^(.)/%252F(.)$ http://www.mydomain.com/$1$2 [N]

any help will be appriciated
thx
yossef

yossef,

First, WELCOME to SitePoint’s Apache forum.

Please be courteous and NOT hijack someone else’s thread.

If you’ve read the tutorial (as it appears you have), you’d have seen that the space, i.e., %20, MUST be referenced in a character range definition as [\ ], an escaped SPACE! I’m not sure what character /%252F is but you would treat it the same way (without the necessity of escaping it in the character range definition). In other words,

RewriteRule ^(.*)[X](.*)$ $1$2 [R=301,N]

where X is the character you’re getting rid of and the R=301 tells SE’s to update to get rid of that character in their database, too.

Regards,

DK