2012-12-24 101 views
1

需要一個.htaccess做到以下幾點,我無法得到它的工作:的.htaccess特定子目錄重定向到查詢字符串參數

重定向/recordings/結尾的網址?recordings

例如:

www.mysite.com/example-product-one/recordings/ 

成爲

www.mysite.com/example-product-one/?recordings 

或者,

www.mysite.com/products/category/three/recordings 

成爲

www.mysite.com/products/category/three/?recordings 

建議?謝謝。

回答

-2

感謝您指出我在正確的方向......這是結束了工作:

RewriteEngine On 
RewriteBase/
RewriteRule /recordings/$ %{REQUEST_URI}../?recordings [L,R=301] 
0

你可以試試這個:

RewriteEngine On 
RewriteBase/
RewriteCond %{REQUEST_URI} ^/(.*)/([^/]+)/?$ 
RewriteRule .* %1/?%2  [L,R=301] 
相關問題