【问题标题】:mod_rewrite - redirect from old url to new urlmod_rewrite - 从旧 url 重定向到新 url
【发布时间】:2013-09-04 09:08:18
【问题描述】:

需要您的专业帮助。

我有 Joomla 1.5 和 VirtueMart

我们更改了 SEF,旧的 url 不见了:(

旧网址:

http://example.com/126-name-group/147101.html

126-name-group - 类别名称 126 - 类别 ID。

147101.html - 产品

147101 - 标识产品

新网址:

http://example.com/katalog/product/126/147101.html

目录/产品 - 是恒定的

我不是 mod_rewrite 专业的:(

感谢您的帮助。

【问题讨论】:

  • 这很可能与 mod_rewrite 无关,但与 SEF 扩展规则有关。不同的 SEF 扩展使用不同的方法来生成 URL。即使您重写了 URL,也会产生您抱怨的原始链接,而不知道重写更改。您需要指定您使用的 SEF 扩展,以确定如何设置正确的路由。

标签: mod-rewrite joomla sef


【解决方案1】:

在您的 .htaccess 中的所有其他规则之上使用此规则

RewriteRule ^([0-9]+)-[^/]+/([0-9]+\.html)$ /katalog/product/$1/$2 [R=301,L]

【讨论】:

    猜你喜欢
    • 2011-04-26
    • 2010-11-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-19
    • 2014-04-10
    相关资源
    最近更新 更多