【发布时间】:2019-04-06 16:51:58
【问题描述】:
我想在产品的 URL 中添加产品类别,并为 Magento 网站添加从旧 URL(无类别)到新 URL(有类别)的 301 重定向。
有近 6000 种产品,有 30 个不同的类别,因此无法在 .htaccess 中添加所有重定向。
这是我正在尝试做的示例-
旧网址看起来像 - http://domainname.com/product-name.html
新 URL 看起来像 - http://domainname.com/category/product-name.html
配置 URL 很容易,但我想为 SEO 添加 301 重定向。
这样,如果有人在搜索结果中点击旧 URL - http://domainname.com/product-name.html,那么他应该被重定向到 http://domainname.com/category/product-name.html
谢谢。
【问题讨论】:
标签: php magento redirect http-status-code-301