本文章来给大家介绍关于在使用linux中提示The requested URL *** was not found on this server错误解决办法,有需要了解的朋友可进入参考。 b* 4[)Yg4
*&X.
因为之前别人在服务器上装了nginx,我装了apache后,访问出现The requested URL *** was not found on this server,查看了下/etc/httpd/conf/httpd.conf,发现原因: 5MJ`B:He+
WeGT}
DocumentRoot指向错误,于是修改之,另外确保你的apache开启了rewrite_module模块 7p""5hw
|;q*Zy(
Apache的rewrite_module模块,支持.htaccess A(y^1Nm
} G$rr.G
9OB[ig
rewrite_module没开启,开启过程如下: {.9phW4Vr?
J&~nD(&TY
centos的配置文件放在:/etc/httpd/conf/httpd.conf X<s']C9c
<Vp7G%"'W
打开文件找到:LoadModule rewrite_module modules/mod_rewrite.so 't=\YFQ*v
Xz5 aTJ&
将前面"#"去掉,如果不存在则添加上句。 Xui${UYN
r@+IDW.=9
如果你的网站是根目录的话:找到 _xign 3
07-S%L7Z
1 "HFS5Bj'
2 !]Z> T5$
3 -bSe=09;S|
4 GP ;c$pC
<Directory /> W5*%n]s~
Options FollowSymLinks FQ?,&s$Bmd
AllowOverride None C,C%1
</Directory> B M{GSX
将上面的None改为All {e[S?1t=l
0~RsdQGqC
如果你的站点不在根目录,设置如下: DHGv<
F@
i](,s.
1 %a+X\\v2
2 Ea1{9>S
3 ,.tT9?
m
4 qie7iE`o
5 =25qY"Mf
6 (,Yb]/O*
<Directory "/var/www/html/my_directory"> i0,{*LD%^
,5'LbO-
Order allow,deny )gV+BHK
Allow from all :w(J=0Lt
AllowOverride All sW+YfJT
</Directory> "e g`3v
OK,然后重启服务器,service httpd restart ,这样.htaccess就可以使用了 Y\BB;"x1