Answer the question
In order to leave comments, you need to log in
Can you help me redirect to .htaccess?
There is a site domain.ru, all content was in the folder domain.ru/5/domain.ru/
I.e. url like domain.ru/5/domain.ru/123.html, domain.ru/5/domain.ru/dir1/456.html
Now everything has been moved to the root, I'm trying to create .htaccess in folder 5
RewriteEngine on
RewriteRule (.*) http://domain.ru/$1 [NC,L,R=301]
Answer the question
In order to leave comments, you need to log in
Perhaps not enough RewriteBase
.
But I would do this:Redirect 301 /5/domain.ru/ /
If the file is in folder
5./5/.htaccess
RewriteEngine on
RewriteRule ^domain\.ru/(.*)$ http://domain.ru/$1 [L,R=301]
RewriteEngine on
RewriteRule (.*) http://domain.ru/$1 [L,R=301]
Place at the very beginning of the file (this matters)
RewriteBase /
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain\.ru$
RewriteRule ^5/domain\.ru/(.+)$ http://domain.ru/$1 [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question