/ Published in: Apache

There is a domain: domain.ru
There are subdomains subdomain.domain.ru and forum.domain.ru
domain.ru is configured as a host and is located in the folder ... / www / domain /
Subdomains are aliases of the main domain - i.e. lead to the same folder ... / www / domain /
Idea: make subdomains refer to folders, inside the main domain folder, i.e.
subdomain.domain.ru -> ... / www / domain / sd_subdomain / subdomain /
forum.domain.ru -> ... / www / domain / sd_subdomain / forum /
Here is what you need to register in .htaccess
There are subdomains subdomain.domain.ru and forum.domain.ru
domain.ru is configured as a host and is located in the folder ... / www / domain /
Subdomains are aliases of the main domain - i.e. lead to the same folder ... / www / domain /
Idea: make subdomains refer to folders, inside the main domain folder, i.e.
subdomain.domain.ru -> ... / www / domain / sd_subdomain / subdomain /
forum.domain.ru -> ... / www / domain / sd_subdomain / forum /
Here is what you need to register in .htaccess
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{HTTP_HOST} (.*)\.domain\.ru RewriteCond $1 !^sd_ RewriteRule (.*) /sd_subdomain/%1/$1 [L]
URL: http://backnet.ru/2014/04/29/redirekt-poddomenov-v-papku-na-osnovnom-domene/
Comments
