首页 > 解决方案 > 如何将 URL 后缀添加到自定义路由?

问题描述

我使用自定义路由创建了一个扩展:http ://example.com/myroute/ 。

我该怎么做:http://example.com/myroute .html

如何在路线末尾添加“.html”?

标签: phpmagentomagento2

解决方案


更简单的方法是创建自定义 URL 重写。

在 Magento BO 中,转到Marketing => SEO & Search => URL Rewrites => Add URL Rewrite

  1. 请求路径:myroute.html
  2. 目标路径:myroute
  3. 重定向类型:否

推荐阅读