New answers tagged url-rewriting
1
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 ...
2
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 ^(.*)$ http://example.com/...
Top 50 recent answers are included
Related Tags
url-rewriting × 485htaccess × 183
mod-rewrite × 130
url × 112
seo × 99
apache × 77
redirects × 68
iis × 32
php × 30
iis7 × 25
301-redirect × 23
nginx × 23
wordpress × 21
apache2 × 21
clean-urls × 21
canonical-url × 19
google × 17
https × 15
domains × 13
subdomain × 12
masking × 10
search-engines × 9
search-engine-indexing × 8
url-parameters × 8
web-hosting × 7