我已經安裝了一個乾淨的Apache2(加上PHP &MySQL)服務器,並在Apache配置中啓用了mod_rewrite
。 我添加了.htaccess
文件以從CodeIgniter wiki中描述的url中刪除index.php。CodeIgniter的重寫不起作用
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
我把這個文件放在網站的根目錄下。
當我嘗試訪問url mydomain.local/index.php/welcome
然後我得到CodeIgniter的默認頁面。但是,當我嘗試通過mydomain.local/welcome
訪問相同的頁面時,我得到了404頁面。
如何檢查整個重寫規則是否正常工作?爲什麼它不工作?
謝謝......正好解決了我的問題 – hforbess