【发布时间】:2015-03-14 07:30:16
【问题描述】:
我在某个域上有一个网站。 以及子域上的另一个网站(指向一个文件夹)。
我在尝试访问子域上的网站时收到此错误:
strong text
禁止
您无权访问此服务器上的 /index.php。
在 main-website 的 htaccess 中,我看到此代码删除 index.php 以使 url 干净:
#### remove index.php ##########################
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php(.*)\ HTTP/ [NC]
RewriteRule ^index\.php(.*)$ http:\/\/www.mainsite.com/$1 [R=301,L]
但是在可以通过子域
访问的网站上
子文件夹中的数据,
. . .
我似乎需要 index.php(对吗?)
所以问题是: 我怎样才能允许 index.php 仅针对 子文件夹/子域的请求?
【问题讨论】:
标签: .htaccess mod-rewrite subdomain