标签: .htaccess url-redirection http-status-code-301
我想将旧的动态网址重定向到新的动态网址,如下所示:
http://example.com/test1/parent_record/requested_record 至 http://example.com/test/detail/requested_record
有任何建议怎么做?
答案 0 :(得分:1)
您可以将此通用RedirectMatch规则用作您的第一条规则:
RedirectMatch
RedirectMatch 301 ^/test1/[^/]+/(.+)$ /test/detail/$1