Answer the question
In order to leave comments, you need to log in
.htaccess - how to redirect to a subdomain and retain access to certain files?
For example, there is a domain - mydomain.com
And there is an old site on the 3rd level domain site.mydomain.com
You need to make a redirect from the main domain to this site, which is safe from the point of view of indexing by search engines.
But while maintaining access to a bunch of different files like mydomain.com/xml/configs.xml
Answer the question
In order to leave comments, you need to log in
use the right conditions in the RewriteCond, like this:
# если не файл
RewriteCond %{REQUEST_FILENAME} !-f
# делаем редирект
RewriteRule ^(.*)$ http://site.mydomain.com/$1 [L,QSA,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question