0
我試圖將不存在的網頁重定向到我的index.php。
我在與index.php相同的文件夾中創建了一個.htaccess文件。
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
Rewritecond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
我使用Wampserver和Apache服務器httpd.conf中設置爲
的AllowOverride所有
但仍當我嘗試輸入一個不存在的網頁我得到404錯誤。 有什麼想法?
編輯。 順便說一句,我看到這篇文章HERE並嘗試過那裏的東西,但它不適合我。
請試試這個,謝謝。 –