wordpress 在wamp中安装好后,其他主机访问被拒绝 403 forbidden

在window服务器上用wamp搭建完环境后,输入IP地址,出现Forbidden

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

Apache/2.4.23 (Win64) PHP/5.6.25 Server at123.207.226.239 Port 80

错误。

在网上查询后,定位到Apache配置文件httpd-vhosts.conf虚拟机配置文件。发现配置文件里有AllowOverridenone,Require local。

AllowOverride参数就是指明Apache服务器是否去找.htacess文件作为配置文件,如果设置为none,那么服务器将忽略.htacess文件,如果设置为All,那么所有在.htaccess文件里有的指令都将被重写。

Require local大致意思就是只允许本地服务器访问。

解决方法:

把AllowOverride none 改为AllowOverrideall。

把Require local删掉或用#注释掉

添加Require all granted这条语句,意思是允许所有请求访问资源。

猜你喜欢

转载自blog.csdn.net/chunfangzhang/article/details/82388549
今日推荐