【问题标题】:htaccess 301 to dynamic URLs redirect to New dynamic URLshtaccess 301 到动态 URL 重定向到新的动态 URL
【发布时间】:2015-09-21 08:27:44
【问题描述】:

我想将旧的动态 URL 重定向到新的动态 URL,如下所示:

http://example.com/test1/parent_record/requested_recordhttp://example.com/test/detail/requested_record

有什么建议吗?

【问题讨论】:

  • /test/detail/ 会是所有新 URL 之前的静态文本吗?
  • 是的 /test/detail/ 将是静态的

标签: .htaccess url-redirection http-status-code-301


【解决方案1】:

您可以使用这个通用的RedirectMatch 规则作为您的第一条规则

RedirectMatch 301 ^/test1/[^/]+/(.+)$ /test/detail/$1

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-12
    • 2013-08-29
    • 1970-01-01
    相关资源
    最近更新 更多