2013-08-05 160 views
0

我試圖重寫規則的htaccess動態創建子文件夾/folder/folder/folder/folder/index.php?product=car的.htaccess重寫動態子文件夾

我想這樣folder/folder/folder/folder/product/car

代碼

RewriteCond %{QUERY_STRING} ^product=1$ 
RewriteRule ^([^/]+)/? index.php?product=$1 [L] 

回答

0

如果我理解正確規則

RewriteEngine On 
RewriteRule ^((?:[^/]+?/)*)product/(.+)$ $1index.php?product=$2 [L,NC] 
+0

@Lm ieee它可以工作。由於文件夾是動態的,因此需要抓取網址 – user2625307