1
一個獲取參數的在我的.htaccess我有以下規則被不創建API
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule productApi/(.*)$ productApi.php?category=$1 [QSA,NC,L]
</IfModule>
當我與MYSERVER/productAPI /布 要求給它裝上productAPI.php但是$ _REQUEST是空的,它本應是一個數組[「類別」 =>「布」]
我已經建立了對mod重寫trace8日誌和我得到以下日誌
add path info postfix: D:/myshop/productApi.php -> D:/myshop/productApi.php/cloths
strip per-dir prefix: D:/myshop/productApi.php/cloths -> productApi.php/cloths
applying pattern 'productApi/(.*)$' to uri 'productApi.php/cloths'
pass through D:/myshop/productApi.php
add path info postfix: D:/myshop/productApi.php -> D:/myshop/productApi.php/cloths
strip per-dir prefix: D:/myshop/productApi.php/cloths -> productApi.php/cloths
applying pattern 'productApi/(.*)$' to uri 'productApi.php/cloths'
pass through D:/myshop/productApi.php
strip per-dir prefix: D:/myshop/cloths -> cloths
applying pattern 'productApi/(.*)$' to uri 'cloths'
pass through D:/myshop/cloths
我已經閱讀並改變了許多不同的東西,但它並沒有幫助我。 我不知道是什麼問題,但它如何處理重寫規則有問題。 任何幫助將不勝感激