【问题标题】:url redirection in magento not working with index.phpmagento 中的 url 重定向不适用于 index.php
【发布时间】:2014-10-10 05:51:45
【问题描述】:

我想在 magento 中重定向 url。我正在使用“URL 重写管理”。

我们希望这个路径“/index.php?cPath=1”重定向到“baby-prams-strollers.html”这个路径。

我输入了这种类型的数据

Request Path *   index.php?cPath=1
Target Path      baby-prams-strollers.html

但它会在主页上重定向。我们想在 baby-prams-strollers.html 上重定向这条路径。我们应该怎么做?请给我建议。

如果我们输入了这种类型的数据

Request Path *   ?cPath=1
Target Path      baby-prams-strollers.html

现在它将被重定向到“baby-prams-strollers.html”这个路径,但 url 带有 index.php/baby-prams-strollers.html。现在我们在 URL 中不需要 index.php。我们如何删除此 URL 中的 index.php。我们已经在所有 url 中删除了 index.php。但是当我们重定向这种类型的url时,它会在index.php中添加url。

提前致谢。

【问题讨论】:

    标签: .htaccess magento url-redirection


    【解决方案1】:

    您需要在 Magento 根文件夹中添加 .htaccess 文件,如下所示:

    RedirectMatch 301 /index.php?cPath=1(.*) /baby-prams-strollers.html$1
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-02
      • 2012-11-22
      • 1970-01-01
      • 2012-10-10
      • 2021-10-10
      • 2014-12-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多