【发布时间】:2015-08-04 15:40:06
【问题描述】:
我想将我的子域重定向到它的索引文件,将主域重定向到它自己的索引文件。
例子
对于 www.example.com -> index.html
subdomain.example.com - >index.php
我对主域有以下规则
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.html [QSA,L]
www.example.com 根文件夹是 public/
同时
subdomain.example.com 根文件夹是 public/folder/
主域重定向正在运行。但是如何将 subdomain.example.com 重定向到它的 index.php 即到 public/folder/index.php ?应该有单独的 .htaccess 文件还是公共文件?
【问题讨论】:
标签: apache .htaccess mod-rewrite redirect