如何使用 htaccess 进行 301 重定向?
http://example.com/category/produkter_and_service
到
http://example.com/products
虽然不影响这样的类别中的帖子:
http://example.com/category/produkter_and_service/ventiler-og-bakkekraner/
我尝试过这样的:
Redirect 301 /category/produkter_and_service http://www.example.com/products
但它也会影响内部的帖子页面,例如:
/category/produkter_and_service/some_product
最佳答案
重定向指令匹配完整的 uri 字符串,您需要使用 RedirectMatch 来代替:
RedirectMatch 301 ^/category/produkter_and_service$ http://www.example.com/products
关于wordpress - WordPress 中的 htaccess 301 重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36690135/