我的htaccess文件中包含以下代码:
Redirect /produkte/category/subcategory/ https://www.newsite.com/category/subcategory
Redirect /produkte/category/subcategory/product/ https://www.newsite.com/category/product
第一行正常,但第二行重定向到行组合:
https://www.newsite.com/category/subcategoryproduct
这个示例是简单的示例之一,但是有一些更复杂的链接,如何使每行与前面的行分开考虑?
答案 0 :(得分:0)
谢谢大家, 解决方法:
RewriteCond %{QUERY_STRING}
RewriteRule ^/produkte/category/subcategory/$ https://www.newsite.com/category/subcategory? [R=301,NE,NC,L]
RewriteCond %{QUERY_STRING}
RewriteRule ^/produkte/category/subcategory/product/$ https://www.newsite.com/category/product? [R=301,NE,NC,L]