【问题标题】:301 redirect to new page keep query string301重定向到新页面保留查询字符串
【发布时间】:2014-06-13 08:48:20
【问题描述】:

我想做一个从 old_page.phpnew_page.php 的 301 重定向,并保留所有查询字符串(如果存在)。

所以old_page.php 会重定向到new_page.php

old_page.php?test=1 会重定向到new_page.php?test=1

这是我下面的内容,但这是一个 404 错误。

RewriteEngine on 
RewriteRule ^old_page.php(.*) new_page.php$1 [R=301,L]

【问题讨论】:

标签: .htaccess redirect http-status-code-301


【解决方案1】:

这行得通:

Redirect 301 /old_page.php /new_page.php

【讨论】:

猜你喜欢
  • 2015-06-06
  • 2014-05-30
  • 2016-02-11
  • 2013-08-06
  • 1970-01-01
  • 1970-01-01
  • 2017-08-11
  • 2015-03-30
  • 2016-04-25
相关资源
最近更新 更多