S
S
Sergey Vinogradov2020-08-24 13:49:12
htaccess
Sergey Vinogradov, 2020-08-24 13:49:12

Can't redirect with a URL with square brackets in the address?

I can't add a redirect to the main page in the .htaccess rule, I suspect it's because the URL starts with square brackets. We have the following address of the form:

https://site.ru/]%FD%EB%E5%EA%F2%F0%EE%E8%E7%E5%F0%E8%F2%E5%EB%FC%ED%FB%F5/*директории_и_файлы_разного уровня вложенности*/


from it it is necessary to redirect to the main page.
Of the features of the script:
The classic scheme in .htaccess does not work:
Redirect /old/ www.site.ru/new - does not work
This way it works:
RewriteRule old site.ru/new/$1 [R=301,L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-08-24
@Opt

RewriteRule ^\]\xFD\xEB\xE5\xEA\xF2\xF0\xEE\xE8\xE7\xE5\xF0\xE8\xF2\xE5\xEB\xFC\xED\xFB\xF5  https://site.ru/ [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question