新部署到服務器 報 The requested URL /home/profession was not found on this server. 錯誤


 

The requested URL /home/profession was not found on this server.

 

通過xxx.com, 首頁可以正常訪問,xxx.com/xx/xx 就出現 The requested URL xxx was not found on this server.

 

1,找到apache配置文件httpd.conf配置文件中的

AllowOverride none        
Require all denied

改成

Options Indexes FollowSymLinks    
AllowOverride All

 

2,找到apache配置文件httpd.conf配置並開啟重寫模塊

LoadModule rewrite_module modules/mod_rewrite.so 

Ubuntu16.04模塊在  /etc/apache2/mods-available 下,需要鏈接到  mods-enable 下

ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load

 

 

 3.加在重寫,站點缺少 .htaccess 文件(文件在public下,沒有就新建)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

 

 

 

 

 


免責聲明!

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



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