apache - htaccess 拒绝所有获取 apache 服务器测试页面

标签 apache .htaccess

我已安装 zpanelcentos 6.3 .
现在有什么问题。

我已添加域 mydomain.com我添加了空白 index.php文件。
我也加了.htaccess带有“拒绝所有人”的文件
现在,当我在浏览器中打开页面时,我得到的是 Apache 2 测试页面 403 Forbidden但是如果我打开 http://mydomain.com/index.php ,现在我得到 403 Forbidden。

我试图编辑 apache 配置文件 Directoryindex但没有积极的结果。任何人都可以帮助我吗?

最佳答案

尝试禁用默认的 Apache CentOS 欢迎页面:

#
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.
#
<LocationMatch "^/+$">
    Options -Indexes
    ErrorDocument 403 /error/noindex.html
</LocationMatch>

编辑文件 /etc/httpd/conf.d/welcome.conf并评论一切。只需删除 welcome.conf文件(或将其重命名为 .conf.disabled 例如)也应该可以解决问题。

然后,重新加载 apache 配置( service httpd restart ),事情应该按预期工作。

关于apache - htaccess 拒绝所有获取 apache 服务器测试页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14001228/

相关文章:

apache - 如何仅使用 .htaccess 文件设置 ssl

javascript - 具有双重操作的页面重定向

python - Django : Timeout when reading response headers from daemon process 的 mod_wsgi 错误

apache - jkmount 将挂载路径传递给 tomcat

php - 移动网站的 HTML 压缩

php - htaccess 404 在添加尾部斜杠时无法正常工作

apache - 阻止(停止)Apache 记录特定的 AJAX/XmlHttpRequest?

java - 使用 Java 的 HttpUrlConnection PATCH 请求

php - 只允许 PHP 脚本打开像 www.mydomain.com/topsecret/1/001.jpg 这样的 url

php - 如何重定向到 symfony 的 web/app.php