【发布时间】:2021-05-25 15:09:29
【问题描述】:
我正在尝试将对我们旧博客的请求重定向到子域上的新 URL。 旧网址看起来像
https://www.website.com/blog-name/post/slug-of-the-title
它需要重定向到
https://stage.website.com/blog-name/slug-of-the-title
我在我的 .htaccess 中使用这个规则
RedirectMatch ^/blog-name/post/(.*)$ https://stage.website.com/blog-name/$1
我被重定向到正确的页面,但我的网址最后有额外的段。喜欢
https://stage.website.com/blog-name/slug-of-the-title/?/blog-name/post/slug-of-the-title
我做错了什么?
【问题讨论】:
标签: apache .htaccess redirect mod-rewrite url-rewriting