New answers tagged


Expanding on the earlier answer, you could use a single mod_rewrite rule to handle different robots.txt files for any number of subdomains. For example: RewriteEngine On # Rewrite "robots.txt" to "robots-<subdomain>".txt RewriteCond %{HTTP_HOST} ^(?!www)([a-z]+)\.example\.com RewriteRule ^robots\.txt$ robots-%1.txt [L] Any request ...


You'll need SSL certs that cover the subdomains if users are going to be requesting the subdomain over HTTPS - there is no other way around this without the user getting a browser warning (or failure to connect). In order for me to try and mimic subdomains, I have the following rewrite rule which is currently disabled. #RewriteRule ^(.*)$

Top 50 recent answers are included