Answer the question
In order to leave comments, you need to log in
How to redirect from /ru to without /ru in htaccess?
Because of Laravel, I haven’t encountered htaccess for a long time, now I can’t understand where I’m making a mistake.
I need to make a 301 redirect like this:
site.ru/ru -> site.ru/
site.ru/ru/path -> site.ru/path
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^ru/(.*)$ https://%1/$1 [R=301,L]
Answer the question
In order to leave comments, you need to log in
RewriteRule ^ru(?:/(.*))?$ /$1
Append immediately after RewriteEngine On
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question