微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决通配符子域中的索引文件无效

我正在使用通配符子域开展项目 虽然我创建了一个 .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 举报,一经查实,本站将立刻删除。