我試圖讓我的 GET 引數作為目錄顯示在 url 中。因此,mywebsite/?pix=5 將顯示為 mywebsite/5。我只需要查找數字。我有以下 .htaccess 代碼,但我只是收到 404 Not Found。任何幫助,將不勝感激。
Options FollowSymLinks
RewriteEngine on
#don't use .php file extension
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]
#test get peram to directory
RewriteRule ^([0-9] )/$ /index.php?pix=$1
uj5u.com熱心網友回復:
你的代碼幾乎沒問題。嘗試這個:
RewriteRule ^([0-9] )$ index.php?pix=$1
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/534341.html
標籤:.htaccess得到
