G
G
gipsonsuro2021-01-24 01:53:58
URL Handling
gipsonsuro, 2021-01-24 01:53:58

How to redirect "domain.ru/?" on "domain.ru"?

Hello! Please tell me the solution to the problem, I can not redirect from "domain.ru/?id=section" to "domain.ru/section" . generally noticed that after domain.ru/? you can write any characters and the link will work, the problem is in this sign "?" how to remove it or what is the way out?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2021-01-24
@shambler81

So if you need exactly with this get parameter

RewriteCond %{QUERY_STRING} (?:^|&)id\=раздел(?:$|&)
RewriteRule ^$ /? [L,R=301]

And if you just remove the get parameter, then put a question mark at the end and this will mean the get will be deleted.
RewriteRule ^$ / ?[L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question