【问题标题】:How to auto-generate Magento URL Rewrites?如何自动生成 Magento URL 重写?
【发布时间】:2012-04-11 04:16:57
【问题描述】:

我已经为我正在处理的项目调整了 Ebizmarts Customerprofile 模块,我需要自动将任何请求重写为:

mymagestore.com/profile/USERNAME 

mymagestore.com/customerprofile/account/view/username/USERNAME

听起来很简单,但这些是我正在考虑的选项。过去有没有人这样做过,如果有,你是怎么做到的?

  1. .htaccess RewriteRule (con: 在 Magento 之外)
  2. 用于创建 Magento URL 重写的自定义 Magento 索引过程(专业:在 Magento 内,是进行其他清理的好时机,反对:更多工作)
  3. 观察何时保存客户对象并创建 URL 重写(赞成:在 Magento 中,反对:可能留下孤立的行,可能无法升级)

感谢您的宝贵时间, 威尔逊

【问题讨论】:

  • #1 - “在 Magento 之外”并不是一个骗局。这是最简单的解决方案。我建议使用它。

标签: magento


【解决方案1】:

好点扎卡里。对于任何正在寻找的人,我发现执行自定义 Magento RewriteRule 的唯一方法是将 mod_proxy 与 P 标志一起使用。

RewriteRule ^profile/(.*)$ /customerprofile/account/view/username/$1 [P]

详情:

http://httpd.apache.org/docs/current/rewrite/flags.html#flag_p

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-02-19
    • 2012-09-09
    • 2013-01-07
    • 2011-04-17
    • 1970-01-01
    • 1970-01-01
    • 2013-04-06
    • 1970-01-01
    相关资源
    最近更新 更多