我有一個自定義的MVC應用程序,其中使用了IndexController
命名約定,這是我在WAMP上構建的。今天我試着把它放到Linux(LAMP)中。奇怪的是,它給出錯誤「頁面未找到」。任何人都可以幫忙嗎?我在國防部重寫不好,Apache重寫URL,在WAMP中工作,不在LAMP中
以下是代碼
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?request=$1 [L,QSA]
網址是
http://hostname/mvc/incident/add
錯誤是請求的網址/ app01 /用戶/的public_html /在此服務器上找不到mvc/index.php。
我檢查httpd.conf中,發現了mod_rewrite啓用 的LoadModule rewrite_module模塊/ mod_rewrite.so – Codemator