0
基本上我已經在我的.htaccess文件在我的網站的根目錄下:PHP/Apache:GET請求不存在?
Options -Indexes
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?route=$1 [L,QSA]
</IfModule>
在當我用我的PHP腳本$ _GET [「路線」]我得到以下錯誤:
Notice: Undefined index: route
我不明白爲什麼這不起作用? 我用這個代碼在過去以前的網站友好的URL和PHP腳本上得到了GET請求值很好,但它現在似乎被打了起來:/
當我做手工像http://localhost/index.php?route=hmm的錯誤消失,我可以得到$ _GET ['route']的值
我在做什麼錯了? 詢問您是否需要任何其他信息! 感謝您的閱讀。
嘗試一些調試。 print_r($ _ GET)說什麼? print_r($ _ SERVER)說什麼? – TuomasR 2010-10-17 17:48:03
你能舉個例子嗎?你在使用框架嗎? – 2010-10-17 17:48:07
TuomasR:print_r($ _GET)outputs Array() – AlexPriceAP 2010-10-17 17:53:38