U
U
utyfua2016-06-15 14:42:10
htaccess
utyfua, 2016-06-15 14:42:10

RewriteCond condition by domain?

Good afternoon. Is that what I did wrong?

RewriteCond %{HTTP_HOST} domain1.ru [NC]
RewriteCond %{REQUEST_URI} !^/domain1.ru/ [NC]
RewriteRule ^(.*)$ domain1.ru/$1.php [L]
RewriteCond %{HTTP_HOST} domain1.ru [NC]
RewriteCond %{REQUEST_URI} !^/domain1.ru/ [NC]
DirectoryIndex domain1.ru/index.php [L]

RewriteCond %{HTTP_HOST} domain2.ru [NC]
RewriteCond %{REQUEST_URI} !^/domain2.ru/ [NC] 
RewriteRule ^(.*)$ /domain2.ru/$1.php [L]
RewriteCond %{HTTP_HOST} domain2.ru [NC]
RewriteCond %{REQUEST_URI} !^/domain2.ru/ [NC] 
DirectoryIndex /domain2.ru/index.php [L]

RewriteCond %{HTTP_HOST} domain3.ru [NC]
RewriteCond %{REQUEST_URI} !^/domain3.ru/ [NC] 
RewriteRule ^(.*)$ /domain3.ru/$1.php [L]
RewriteCond %{HTTP_HOST} domain3.ru [NC]
RewriteCond %{REQUEST_URI} !^/domain3.ru/ [NC] 
DirectoryIndex /domain3.ru/index.php [L]
Thanks for answers!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question