R
R
RobQwerty2021-06-09 14:54:35
htaccess
RobQwerty, 2021-06-09 14:54:35

How to redirect using htaccess from site.ru/? on site.ru?

Greetings, I can’t redirect to the main page from site.ru/? on site.ru
I tried like this:

RewriteCond %{THE_REQUEST} \?
RewriteRule ^$ https://site.ru/ [R=301,L]

Doesn't work...
Doubles of https://site.ru/ and https://site.ru are also displayed. Only https://site.ru/
should be left. Tell me please, how can I implement such a rule? Thank you in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
il io, 2021-06-10
@Psycho-of-Persia

Try
RewriteRule (.+)/$ /$1 [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question