【发布时间】:2017-04-05 15:55:06
【问题描述】:
在我的 .htaccess 文件中,我有以下重定向:
Redirect 301 /About-Us http://www.example.com/about-us
Redirect 301 /About-Us/Profile http://www.example.com/about-us/profile
问题是如果输入以下地址:
www.example.com/About-Us/Profile
上面的代码将其更改为:
www.example.com/about-us/Profile
简而言之;它会更改 URL 的第一位,但不会更改第二位。我怎样才能避免这种情况?我知道用于重定向整个文件夹的RedirectMatch 301 ^/folder/ /new-folder 规则,但这不能满足我们的需求。我也知道大写文件夹不是一个好习惯。我没有建立这个网站。
【问题讨论】:
-
你过得怎么样?
标签: apache .htaccess redirect mod-rewrite http-status-code-301