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 on 2016-02-17 23:30  caigan  阅读(11529)  评论(0编辑  收藏  举报