linux中提示The requested URL *** was not found on this server

本文章来给大家介绍关于在使用linux中提示The requested URL *** was not found on this server错误解决办法,有需要了解的朋友可进入参考。

因为之前别人在服务器上装了nginx,我装了apache后,访问出现The requested URL *** was not found on this server,查看了下/etc/httpd/conf/httpd.conf,发现原因:

DocumentRoot指向错误,于是修改之,另外确保你的apache开启了rewrite_module模块

Apache的rewrite_module模块,支持.htaccess


rewrite_module没开启,开启过程如下:

centos的配置文件放在:/etc/httpd/conf/httpd.conf

打开文件找到:LoadModule rewrite_module modules/mod_rewrite.so

将前面"#"去掉,如果不存在则添加上句。

如果你的网站是根目录的话:找到

<Directory />
  Options FollowSymLinks
  AllowOverride None 
</Directory>

 将上面的None改为All

如果你的站点不在根目录,设置如下:

<Directory "/var/www/html/my_directory"> 

Order allow,deny
Allow from all
AllowOverride All
</Directory>

 OK,然后重启服务器,service httpd restart ,这样.htaccess就可以使用了

posted @ 2015-11-30 14:33  王永东gg  阅读(27951)  评论(0编辑  收藏  举报