htaccess redirect links with   characters

2020-04-18 05:57发布

I want to redirect links containing characters like %C2%A0 on my htaccess file example:

redirect 301 /actualite/presses-plieuses-electriques%C2%A0-les-5-criteres-de-choix_343.html  https://www.mynewsite.com

is not working

redirect 301  /actualite/presses-plieuses-electriques-les-5-criteres-de-choix_343.html  https://mynewsites.com

is working

How do I replace %C2%A0 and %E2%80%99 characters on mylinks ?

1条回答
Fickle 薄情
2楼-- · 2020-04-18 06:27

You can use this RewriteRule rule:

RewriteEngine On

RewriteRule ^actualite/presses-plieuses-electriques\xC2\xA0-les-5-criteres-de-choix_343\.html$ / [L,NC,R=301]

Note use of \xC2\xA0 for %C2%A0

查看更多
登录 后发表回答