xVGERx
xVGERx

Reputation: 41

.htaccess Rewrite %2f

I am trying to redirect using the following:

RewriteRule ^reviews/area/Santa-Barbara%2F$"/reviews/area/santa-barbara" [R=301,NC,L]

I have the AllowEncodedSlashes directive on but the rewrite is still not working. What am I missing?

Upvotes: 3

Views: 2047

Answers (1)

anubhava
anubhava

Reputation: 785128

You need to first use AllowEncodedSlashes directive inside server config and set it to:

AllowEncodedSlashes NoDecode

Then inside your root .htaccess you can use this rule:

RewriteEngine On

RewriteRule ^(reviews/area/Santa-Barbara)\%2f$ /$1 [R=301,NC,L]

Upvotes: 2

Related Questions