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就可以使用了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM