I
I
Igor2016-12-07 02:17:09
htaccess
Igor, 2016-12-07 02:17:09

Several aliases for the site. That's right?

Hello.
You need to add aliases for the site.
Let's say that the site is on site.ru, and you need to add site.com and site.rf to it.
Do not tell me, is it right or did I write nonsense? Alas, there is no way to test.

RewriteCond %{HTTP_HOST} ^www.site.ru$ [NC]
RewriteRule ^(.*)$ http:\\site.ru\$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^site.com$ [OR,NC]
RewriteCond %{HTTP_HOST} ^www.site.com$ [NC]
RewriteCond %{REQUEST_URI} !^/robots.*
RewriteRule ^(.*)$ http://sait.ru/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^xn--80aswg.xn--p1ai$ [OR,NC]
RewriteCond %{HTTP_HOST} ^www.xn--80aswg.xn--p1ai$ [NC]
RewriteCond %{REQUEST_URI} !^/robots.*
RewriteRule ^(.*)$ http://sait.ru/$1 [R=301,L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zooks, 2016-12-07
@zooks

RewriteCond %{HTTP_HOST} ^site.com$ [OR,NC]
RewriteCond %{HTTP_HOST} ^site2.com$ [OR,NC]
RewriteCond %{HTTP_HOST} ^site3.com$ [NC]
RewriteRule ^(.*)$ http://site.ru/$1 [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question