A
A
Artur Lastname2014-09-25 09:47:42
htaccess
Artur Lastname, 2014-09-25 09:47:42

How to make different redirects from index for subdomains?

Interested in how to make the correct redirect to all subdomains in the .htaccess file, now the following is written:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/ 
RewriteRule ^index\.html$ http://site.ru/ [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ 
RewriteRule ^index\.php$ http://site.ru/ [R=301,L]

But if you go to the "moscow.site.ru/index.php" subdomain, it redirects to site.ru (yes, I understand what the rule is and is written in my .htaccess, but how can I correct it for subdomains?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artur Lastname, 2014-11-06
@Kekemeke

Implemented as follows

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/ 
RewriteRule ^index\.html$ %{HTTP_REFERER} [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/ 
RewriteRule ^index\.php$ %{HTTP_REFERER} [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question