【发布时间】:2018-02-02 13:03:50
【问题描述】:
非常简单的 URL 重定向来自:
http://xxxx.net/index.php?k=Nomor-Bangkok&page=0
到:
http://xxxx.net/Nomor-Bangkok/online-0
当我尝试这个时(旧网址到新网址):
Redirect 301 /index.php?k=Nomor-Bangkok&page=0 /Nomor-Bangkok/online-0
我得到一个没有重定向的 200 标头响应。
但是当我把它转过来时(新网址到旧网址):
Redirect 301 /Nomor-Bangkok/online-0 /index.php?k=Nomor-Bangkok&page=0
然后我得到一个从新 URL 到旧 URL 的 301 重定向。但这不是我想要的。
我做错了什么?
【问题讨论】:
-
“我做错了什么?” - Redirect 指令适用于 URL paths,但
/index.php?k=Nomor-Bangkok&page=0不是路径,即一个路径(/index.php)和一个查询字符串(?k=Nomor-Bangkok&page=0)
标签: apache .htaccess redirect mod-rewrite