我有一些RedirectMatch语句将旧的urlsredirect到新的文档,但由于某些原因,他们正常工作,除了它将最初的请求url附加为查询string。 例如。 请求
http://www.domain.com/filename.html
redirect到
http://www.domain.com/new_filename.html?/filename.html
相应的规则是:
RedirectMatch 301 ^/filename.html$ http://www.domain.com/new_filename.html
任何想法为什么发生这种情况?
你的例子不需要RedirectMatch; 使用简单的redirect:
Redirect permanent /filename.html http://www.domain.com/new_filename.mhtml
请记住,redirect工作的url,而不是path。