Answer the question
In order to leave comments, you need to log in
3-level domain via .htaccess, how?
There is a 2nd level site on host-ed.net hosting, you need to add about 30 3rd level domains, the hosting has a limitation - only one 3rd level subdomain. I decided to implement it through .htaccess
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.site\.ru$
RewriteCond %{HTTP_HOST} (www\.)?(.*)\.site\.ru$
RewriteCond %{REQUEST_URI} !public_html/
RewriteRule ^(.*)$ public_html/%2/$1
. I uploaded the region folder into the public_html folder into it index.html, but when I click on the link region.site.ru it gives an error, tell me how to implement it?
Answer the question
In order to leave comments, you need to log in
Only through .htaccess will not work. For your option, you need your provider to set up a wildcard for a third-level domain, and apparently he will not configure this.
No way. The third-level domain must be resolved, for this you need a DNS record.
I did this using the nginx + apache bundle, maybe it will help:
habrahabr.ru/post/101585/
Here I wrote how to make auto-subdomains for the timeweb, maybe it will come in handy for you
http://blare.su/2012/08/how-to-create-automatic-subdomain/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question