.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, but the rewrite still doesn't work. What am I missing?
+3
xVGERx
source
to share
1 answer
You need to first use the AllowEncodedSlashes
directive inside the 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]
+2
anubhava
source
to share