通配符子域中的索引文件无效

问题描述

我正在使用通配符子域开展项目 虽然我创建了一个 .htaccess 文件并放置了一些代码

**

RewriteCond %{HTTP_HOST} ^(^.*)\.hostwebnepal.com
RewriteCond %{REQUEST_URI} !^/%1/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)$ /%1/$1
RewriteCond %{HTTP_HOST} ^(^.*)\.hostwebnepal.com
RewriteRule ^(/)?$ %1/$1 [L]
order deny,allow
deny from all
<files *.html>
order deny,allow
allow from all
</files>
<files *.png>
allow from all
</files>
<files *.css>
allow from all
</files>
<files *.jpg>
allow from all
</files>

**

但这是我的一个问题.. 我想禁止所有文件并允许一些.....但是虽然我放置了一些子域,例如 test.hostwebnepal.com 我无法访问索引文件...

当我点击子域时出现了一些问题

**

Forbidden
You don't have permission to access this resource.
Additionally,a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

**

但是如果我点击像 test.hostwebnepal.com/index.html 这样的完整代码效果很好..

我想在打开子域时显示索引文件,但如何使用此 htaccess 代码实现 我也想保护我的服务器,所以拒绝一些文件..

请告诉我

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)