旧的URL带参数的路径下指标的影响的301重定向 [英] 301 Redirect of old url with parameters to a path without parametes

查看:118
本文介绍了旧的URL带参数的路径下指标的影响的301重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以下要求:

http://somesite.com/home.php?action=page&page_id=9

触发301重定向:

to trigger a 301 redirect to :

http://somesite.com/a-new-page

下面就是我使用的是什么,但它不工作。

Here's what I'm using but it isn't working.

RewriteCond %{QUERY_STRING} ^page_id=9$ [NC]
RewriteRule ^home\.php$ http://somesite.com/a-new-page? [L,R=301]

任何想法?

推荐答案

如果该QUERY_STRING将永远是你需要这样的与之相匹配的是相同的:

If the QUERY_STRING will always be the same you need to match it like this:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^action=page&page_id=9$ [NC]
RewriteRule ^home.php$ http://somesite.com/a-new-page? [L,R=301]

希望这有助于。

这篇关于旧的URL带参数的路径下指标的影响的301重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆