Mac自带apache未开启重写,导致The requested URL /xxx/xxx/xxx was not found on this server

打开默认url首页没有问题,但是加上参数就会报错

The requested URL /***/*** was not found on this server.

开启apache重写

配置httpd.conf文件

sudo vim /etc/apache/httpd.conf

修改两处:

1、
LoadModule rewrite_module libexec/apache2/mod_rewrite.so前面的#(注释)去掉

2、
<Directory "/***/***/***">
			#...
			...
			...
			Options Indexes FollowSymLinks Multiviews
			MultiviewsMatch Any
			#    AllowOverride None		//修改前
			AllowOverride All			//修改后
			Require all granted
</Directory>

重启apache就OK了~

发布了38 篇原创文章 · 获赞 9 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/weixin_42260789/article/details/97903312