当子域也存在时,使用 htaccess 限制对 root 的访问
考虑以下结构:
example.com
定位到 public_html/index.php
example2.com
定位到 public_html/SUB/e2/ index.php
我想删除 example.com
进行维护,并认为 htaccess 将是最好的方法。但后来我开始担心这样做会阻止对第二个(不相关)站点的访问,因为对于服务器来说,它位于第一个站点内。
example.com
上的 htaccess 驱动块也会杀死 example2.com
吗?
Consider the following structure:
example.com
locates to public_html/index.php
example2.com
locates to public_html/SUB/e2/index.php
I want to take example.com
down for maintenance, and thought htaccess would be the best method. But then I became worried that doing so would block access to the second (unrelated) site, because to the server it is located within the first site.
Would an htaccess-driven block at example.com
also kill off example2.com
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
htaccess 文件中不是有“优先级”之类的东西吗?
我的意思是,例如,您首先阻止对“public_html”的访问
,然后允许访问“public_html/SUB/e2”等?
我想必须工作。
Isnt there a thing like "priority" in htaccess files?
I mean e.g. you first block the access to "public_html"
and then allow access to "public_html/SUB/e2" etc. ?
Must work i think.