Cscart 301重定向到Opencart

时间:2016-06-04 18:16:47

标签: .htaccess opencart url-redirection http-status-code-301 cs-cart

我正在尝试从Cscart网址重定向到Opencart网址,但似乎它不起作用。

旧网址(cscart)

https://www.example.com/index.php?dispatch=categories.view&category_id=1430

新网址(opencart)

https://www.example.com/index.php?route=product/category&path=1746

我想为cscart的前10个主要类别和所有其他子类别执行本手册,以重定向到https://www.example.com主页。

我怎么能成功呢? 此外,新网址使用https。

提前谢谢你 -Konstantinos

1 个答案:

答案 0 :(得分:0)

一种简单的手动方式

pip install geopandas
所有其他类别映射的

等等。

另一种方法是捕获旧的RewriteCond %{QUERY_STRING} dispatch=categories.view&category_id=1430 RewriteRule ^index.php$ /index.php?route=product/category&path=1746 [R,L] 并将其与category_id替换URI中的RewriteMap一起使用

RewriteRule

在文件RewriteMap categories txt:/path/to/categories.txt RewriteCond %{QUERY_STRING} dispatch=categories.view&category_id=(\d+) RewriteRule ^index.php$ /index.php?route=product/category&path=${categories:%1} [R,L] 中,您将拥有从旧类别ID到新类别ID的映射

categories.txt

另请参阅txt: Plain text maps以获取更多详细信息或纯文本映射的替代方法。

此方法的缺点是,您无法在.htaccess文件中使用它,只能在主配置或虚拟主机部分中使用。

如果一切正常,您可以将1430 1746 123 456 987 333 更改为R