K
K
Kirill Michenus2021-06-21 12:18:26
Apache HTTP Server
Kirill Michenus, 2021-06-21 12:18:26

How to set up a redirect in .htaccess for unusual characters?

The SEOs asked to redirect correctly 404 links in 301
/articles/%AA%DD/ to /articles/

What doesn't work:

RewriteRule ^articles/\%\A\A\%\D\D/$ /articles/ [L,R=301]
RewriteRule ^articles/%AA%DD/$ /articles/ [L,R=301]
RewriteRule ^articles/ªÝ/$	/articles/ [L,R=301]

How to fix it?
Similarly for /%20%EE%8C%96/ - some kind of hieroglyph.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2021-06-21
@michenusweb

RewriteRule ^articles/\xAA\xDD/$ /articles/ [L,R=301]

Or search after /articles/ for any characters other than letters, numbers and spaces.
RewriteRule ^articles/.*[^\s\w/] /articles/ [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question