【问题标题】:Unable to correct magento product and category urls无法更正 magento 产品和类别网址
【发布时间】:2012-11-26 11:55:18
【问题描述】:

我正在使用 magento 1.7。像http://example.com/men/silver-cufflinks 这样的magento 产品网址然后我想从网址中删除men。我在 url.php 中注释了以下代码

// if (null === $parentPath) {
       // $parentPath = $this->getResource()->getCategoryParentPath($category);
   // }
  //  elseif ($parentPath == '/') {
        $parentPath = '';
   // }

然后清空 core_url_rewrite 表,然后清除缓存并重新索引所有项目,现在我有像 http://example.com/catalog/category/view/s/women/id/181/ 这样的 URL。我想恢复以前的链接,请告诉我该怎么做。我也再次尝试取消我已评论的代码并再次清除表格并清除缓存,然后重新索引所有内容,但我仍然无法修复

【问题讨论】:

    标签: magento url-rewriting


    【解决方案1】:

    我通过 magento-catalog-click 有问题的目录解决了这个问题,然后转到“url key”并将其更改为您想要的。确保在每个商店视图中进行更改,然后单击“保存”。

    例子:

    Catalog
      → General Information
        → Name: Friends
        → Is active: Yes
        → URL key: friends
    Store View: English French German
    

    这些更改将重写所有子类别。

    【讨论】:

      【解决方案2】:

      您是否启用了 URL 重写?

      系统 -> 配置 -> 网页 -> 搜索引擎优化 -> 使用 Web 服务器重写 = 是

      另外你还可以查看:

      目录 -> URL 重写管理

      还有这个链接:http://www.magentocommerce.com/wiki/modules_reference/english/mage_adminhtml/urlrewrite/index

      【讨论】:

        【解决方案3】:

        取消注释代码后,尝试手动清理 url-rewrite 表,然后再次运行 url-rewrites reindex。

        【讨论】:

          【解决方案4】:

          看看@Fixing URL Rewrites with Magento

          要从产品 url 中删除类别路径,您可以从 magento 管理员中完成

          转到管理 -> 系统 -> 配置 -> 目录

          然后在“搜索引擎优化”下将“使用产品 URL 的类别路径”设置为“否”

          【讨论】:

          • 您是在“现场”还是“开发”网站上遇到此问题?
          • 如果您创建一个新产品,该 url 是 seo 友好的还是 /catalog/category/view/s/women..?
          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多