.htaccess重定向到子文件夹(如果域名是基本域名)

时间:2016-03-26 01:12:54

标签: .htaccess

domain => subdomain.domain.com
target => subdomain.domain.com/Controller/Method

我会

IF %{HTTP_HOST} == base_url(subdomain.domain.com) 

重定向到目标(subdomain.domain.com/Controller/Method)

我没有修复基本域名

2 个答案:

答案 0 :(得分:0)

尝试:

# Considering that base domain URL excludes index.html, index.php, welcome.html or something like that, we'll reduce matches to http(s)://base.subdomain/ and http(s)://base.subdomain
RewriteCond %{REQUEST_URI} ^\/?$
RewriteRule /Controller/Method

答案 1 :(得分:0)

您可以使用以下规则:

|