【问题标题】:htaccess URL overwrite - Magentohtaccess URL覆盖 - Magento
【发布时间】:2014-12-17 17:27:15
【问题描述】:

我有一些需要覆盖的 URL,因此如果有人查看源代码,他们实际上无法在 Magento 中看到产品图像的真实 URL。目前,链接为

externalsub.domain.com/images/image123.jpg

我想变成这样

mydomain.com/images/image123.jpg

如何通过 .htaccess 实现这一点?非常感谢任何帮助!

【问题讨论】:

  • 你的 apache 服务器中加载了 mod_proxy 吗?
  • 我在 apache 上有 mod_proxy。

标签: .htaccess magento url-rewriting


【解决方案1】:

然后在 htaccess 文件中,您可以使用它(在您可能已经拥有的任何规则之上):

RewriteEngine On
RewriteRule ^images/([^/]+\.(?:jpe?g|png|gif))$ http://externalsub.domain.com/images/$1 [L,P]

如果你已经拥有了开启重写引擎的那一行(只需要在你的文件中一次)。

【讨论】:

  • 抱歉有紧急情况,之前无法测试。这不会改变任何事情。旧 URL 仍保持原样。有什么想法吗?
猜你喜欢
  • 1970-01-01
  • 2017-08-02
  • 2012-07-09
  • 1970-01-01
  • 2013-11-02
  • 2014-12-31
  • 1970-01-01
  • 1970-01-01
  • 2013-10-15
相关资源
最近更新 更多