A
A
Artem2017-08-11 10:02:59
PHP
Artem, 2017-08-11 10:02:59

How to create a rule in .htaccess for a redirect?

Good afternoon!
The task is to make a redirect from a page like " http://site.ru////xn--80sdgasdgasd.xn--p1ai/intent... " to the main page.
Redirects from pages of a simple type site.ru/request , etc. work, no problems.
Here is a combination of non-standard values ​​in the url:
- encoded Cyrillic domain
- tick symbol
- and several slashes in a row
The browser will redirect this page to http://site.ru/xn--80asdgasdg.xn--p1ai/intentions/...
The following options don't work:
redirect 301 http://site.ru////xn--80sdgasdgasd.xn--p1ai/intent... site.ru
redirect 301 "http://site.ru////xn--80sdgasdgasd.xn--p1ai/intent... " site.ru
redirect 301 " http://site.ru/xn--80asdgasdg.xn--p1ai/ intentions/... " site.ru
RewriteRule ^(.*).xn--p1ai\/intentions\/?(.*)$ http:/site.ru$1 [R=301,L]
and similar combinations.
Prompt , please, how to make a rule for this kind of link.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2017-08-14
@artemky

Here is the rule that worked:
RewriteRule ^(.*).xn--p1ai/intentions(.*)$ /? [L,R=301]
Most likely due to server settings punycode was not processed in htaccess

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question