是的,我知道這已被問了數百次。但我找不到實際可行的版本。目前,我目前使用的所有功能目前都在刪除.php
,但那是問題出現的時間。我網站上的幾個頁面取決於$_GET
請求,例如profile
因此,當您訪問url http://www.example.com/profile?username=System時,您將獲得404,而沒有?username=System
,則可以正常工作。當前的代碼我已經是刪除網址中的後綴
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
你有你的Al lowOrverride設置爲全部?在xammp和http-conf中?還把選項索引FollowSymLinks包括ExecCGI在你的http.conf –
這是託管在遠程服務器上,所以我不知道,但在我決定改變頁面系統之前,重寫像這樣工作得很好。但是,然後頁面由index.php完成?page = profile&username = System – ChocCookieRaider
由於規則集中的條件不匹配,顯然沒有文件夾'http://www.example.com/ profile?username = System'但是,哪個腳本應該獲取傳入URL中傳遞的參數。即'username = System',名爲'profile'的腳本(profile.php)或另一個不在URL中的名稱,如'index.php'? –