newpoison
newpoison

Reputation: 954

Htaccess redirection with special chars (%E2%80%8E)

The question is very similar to this, but the accepted answer did not work in our case:

Remove string from URL using .htaccees

The website URL we're trying to redirect is the following:

http://www.example.com/fr/sub-folder/%E2%80%8E

The website is running WordPress. We simply want to redirect this url to the base page (http://www.example.com/fr/sub-folder/)

We first tried basic 301:

redirect 301 "/fr/sub-folder/%E2%80%8E" http://www.example.com/fr/sub-folder/

We tried the following:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/([a-zA-Z0-9_-]+)/\%20\%E2\%80\%8E$
RewriteRule ^(.*) http://example.com/fr/sub-folder/%1/ [R,L]

This little variation:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/([a-zA-Z0-9_-]+)/\%E2\%80\%8E$
RewriteRule ^(.*) http://example.com/fr/sub-folder/%1/ [R,L]

But nothing is working.

Any help would be appreciated.

Thanks,

Upvotes: 2

Views: 1392

Answers (1)

anubhava
anubhava

Reputation: 785561

You can just use this rule:

RewriteRule /\xE2\x80\x8E$ /fr/sub-folder [L,R=302]

Upvotes: 2

Related Questions