Answer the question
In order to leave comments, you need to log in
How to remove conflict in .htaccess?
Hello.
There is a site on which it was made that when opening any subdomain (sub.site.ru), content from the main domain (site.ru) was shown, and the subdomain itself (sub) was passed as a get parameter. There were no problems with this part, it was implemented like this:
# DirectoryIndex index.php
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+)\.site\.ru$ [NC]
RewriteRule ^(.*)$ index.php?sub_dom=%2 [L]
RewriteBase /
RewriteCond %{HTTP_HOST} ([a-z0-9-]+).site.ru$
Rewriterule ^robots.txt$ /robots2.txt [L]
RewriteCond %{HTTP_HOST} site.ru$
Rewriterule ^robots.txt$ /robots1.txt [L]
Answer the question
In order to leave comments, you need to log in
Got it right after posting the question.
# DirectoryIndex index.php
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+)\.faberlicproject\.com$ [NC]
RewriteRule ^(.*)[^robots.txt]$ index.php?sub_dom=%2 [L]
# RewriteBase /
RewriteCond %{HTTP_HOST} ([a-z0-9-]+).faberlicproject.com$
Rewriterule ^robots.txt$ /robots2.txt [L]
RewriteCond %{HTTP_HOST} faberlicproject.com$
Rewriterule ^robots.txt$ /robots1.txt [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question