1
所以我有這個在我的htaccesshtaccess的,總是一個GET值
RewriteRule ^page(?:/error(?:/([^/]+))?)?/?$ page.php?error=$1 [L,QSA]
但我總是得到一個空數組是錯誤=「」。任何頁面上的/應該是可選的,但它在$ _GET數組中設置錯誤爲空。
Array ([error] =>)
RewriteEngine on
Options -MultiViews
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^page(?:/error(?:/([^/]+))?)?/?$ page.php?error=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]
還是一樣。我已經用完整的htaccess更新了OP。 – user273324
提供完整的.htaccess,現在就試試。 – anubhava
仍然這樣做。 – user273324