Answer the question
In order to leave comments, you need to log in
301 redirect. how to implement a redirect from site1.ru/? on site1.ru/?
There was a problem with the redirect.
There is a website, let's call it site.ru. Written in pure php. samopis
Here is .htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.site\.ru$ [NC]
RewriteRule ^(.*)$ site.ru/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[AZ]{3,9}\ /([^/]+/)*(default|index|main)\.(html|php|htm)\ HTTP/ [NC]
RewriteRule ^(([^/] +/)*)(default|main|index)\.(html|php|htm)$ site.ru/$1 [L,R=301]
RewriteCond %{QUERY_STRING} ^.+$
RewriteCond %{REQUEST_URI} ^/ $
RewriteRule ^(.*)$ site.ru/? [R=301,L]
how to redirect site.ru/? on site.ru/
Answer the question
In order to leave comments, you need to log in
You will wait a long time for an answer to such a question, smoke mana
Let's break it down point by point
RewriteEngine On
RewriteBase /
тут все понятно
RewriteCond %{HTTP_HOST} ^www\.site\.ru$ [NC]
RewriteRule ^(.*)$ site.ru/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(default|index|main)\.(html|php|htm)\ HTTP/ [NC]
RewriteRule ^(([^/]+/)*)(default|main|index)\.(html|php|htm)$ site.ru/$1 [L,R=301]
RewriteCond %{QUERY_STRING} ^.+$
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ site.ru/? [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question