返回
首页 > 互联网

apache下403(apache 404页面)

时间: 2022-12-05 21:03:49

apache下403(apache 404页面)

直接输入地址显示

Forbidden

You don't have permission to access /news/search_fdsafdsa on this server.

httpd.conf,找到这么一段:

代码如下

<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
deny from all
Satisfy all
</Directory>

然后试着把deny

from all中的deny改成了allow,保存后重起了apache,然后再一测试我的网页,哈哈

ps 403禁止访问 主要民apache中的 Order deny,allow deny影响到了,我们要解决它只需要把deny改成了allow就可以了,当然还有问题就是服务器权限问题。

确保web文件夹下有index.html文件(或名为index而后缀为其他形式(如.jsp .php等)的文件) ,因为Apache默认以index.html为网站首页,如果没有这个文件就会出现上面的403错误。

代码如下

<IfModule dir_module>
DirectoryIndex index.html
</IfModule>

改为(如你想用index.jsp):

代码如下

<IfModule dir_module>
DirectoryIndex index.html index.jsp
</IfModule>

如果需要浏览该文件夹下的内容,可以在前添加:

代码如下

Options Indexes

就可以了。

猜你喜欢

版权所有 Copyright©2022  生活百科 版权所有

联系邮箱:baike#shbk.net