2014-03-29 33 views
1

我需要你的幫助後檢查無處不在。因爲Google網站站長工具將它們視爲重複的標題和說明。htaccess刪除?category_id = xxx數字

我需要從我的複雜URL中刪除一些參數。

FROM: 
http://3dstreaming.org/3d-media/videos/7006-avatar-3d-2009-half-sbs-full-hd-1080-dual-hdf-orn.html?category_id=567 

TO: 
http://3dstreaming.org/3d-media/videos/7006-avatar-3d-2009-half-sbs-full-hd-1080-dual-hdf-orn.html 


where "7006-avatar-3d-2009-half-sbs-full-hd-1080-dual-hdf-orn.html" 
7006=variable value 
avatar-3d-2009-half-sbs-full-hd-1080-dual-hdf-orn=variable words 

and remove ?category_id=567 ("?category_id=xxxNumbers") 

,然後在同一以下參數:

"?start=xxxNumbers" 

"?filter_tag=xxxWords" 

"?pattern=xxxWords" 

有人能幫助我嗎? 在此先感謝

我試着用這個,但不起作用:

RewriteEngine On 
RewriteCond %{QUERY_STRING} ^(.+?&)category_id=[^&]*(.*)$ 
RewriteRule ^(index\.php)?$ %{REQUEST_URI}?%1%2 [R=301,L] 

回答

0

添加以下到您的htaccess應該實現你在找什麼

RewriteEngine on 
RewriteCond %{THE_REQUEST} \?category_id= [OR] 
RewriteCond %{THE_REQUEST} \?start= [OR] 
RewriteCond %{THE_REQUEST} \?filter= [OR] 
RewriteCond %{THE_REQUEST} \?pattern=  
RewriteRule^%{REQUEST_URI}?%1 [L,R=301] 

OR

加入以下內容將刪除全部 p a url

RewriteEngine On 
RewriteCond %{THE_REQUEST} \ /([^\?\ ]*)\? 
RewriteRule^/%1? [L,R=301] 
+1

很棒!非常感謝 !它的工作......你是一個天才!謝謝 – user3475437