您现在的位置: 万盛学电脑网 >> 程序编程 >> 服务器教程 >> 正文

apache下403 Forbidden错误问题解决方法

作者:佚名    责任编辑:admin    更新时间:2022-06-22

   直接输入地址显示

  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

  就可以了。