簡體   English   中英

301 redirect .HTACCESS-刪除查詢字符串

[英]301 redirect .HTACCESS - Remove Query String

我有一個被分析發現的404頁面。 我在找出通過.htaccess重定向下面的鏈接的正確語法時遇到麻煩。 誰能提供解決方案? 非常感謝你。

http://www.mywebsite.com/product-categories?format=feed&type=atom

我嘗試了這個,還有很多其他人都沒有成功。

RewriteCond %{QUERY_STRING} ^format=feed&type=atom$
RewriteRule ^product-categories/$ http://www.mywebsite.com/product-categories/?  [L,R=301]

您的RewriteRule存在條件反轉。 使用以下規則:

RewriteCond %{QUERY_STRING} ^format=feed&type=atom$ [NC]
RewriteRule ^product-categories/?$ /product-categories/? [NC,NE,L,R=301]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM