将子域重定向到主域上的文件夹
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了将子域重定向到主域上的文件夹相关的知识,希望对你有一定的参考价值。
There is a domain: domain.ruThere 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
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www. RewriteCond %{HTTP_HOST} (.*).domain.ru RewriteCond $1 !^sd_ RewriteRule (.*) /sd_subdomain/%1/$1 [L]
以上是关于将子域重定向到主域上的文件夹的主要内容,如果未能解决你的问题,请参考以下文章