【发布时间】:2019-05-17 07:59:41
【问题描述】:
我需要重定向我网站的 URL。其实如何在htaccess中将我的/old/folder重定向到/newfolder
RedirectMatch 301 ^//old/folder. https://website.com/newFolder/
我使用了这个代码:
RedirectMatch 301 ^//old/folder https://website.com/newFolder/
显示错误 404!
【问题讨论】:
-
为什么路径开头有双斜线?当你想要重定向的是一个 static 路径时,为什么还要 RedirectMatch 呢?重定向就足够了,httpd.apache.org/docs/2.4/mod/mod_alias.html#redirect
标签: javascript php .htaccess