除去刚刚"米等于1英寸;从使用的URL重写规则 [英] removing just "?m=1" from url using rewrite rule

查看:166
本文介绍了除去刚刚"米等于1英寸;从使用的URL重写规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我移居我的博客的博客字preSS仅数天。现在我发现crawn错误很多网址,许多网址的结尾的名称和值会出现(?M = 1),显示为404错误,现在我想重定向所有的URL additing .htaccess文件 例如:

just few day before i had migrated my blogger blog to wordpress. Now i find crawn error with many url, at the end of many url the name and value is there (?m=1) which shown as a 404 error now i want to redirect all the url additing .htaccess file example:

http://www.tipsviablogging.com/blogger-tricks/facebook-disqus-tab-in-blogger.html?m=1

musy重定向到

http://www.tipsviablogging.com/blogger-tricks/facebook-disqus-tab-in-blogger.html

任何一个具有URL专长的rewrite好心帮我...

any one is having expertise in url rewrite kindly help me...

推荐答案

我还没有得到一个测试系统方便,但这样的事情在你的的.htaccess 应该做的技巧:

I haven't got a test system handy, but something like this in your .htaccess should do the trick:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^m=1$
RewriteRule ^(.*)$ /$1? [R=301,L]

如果没记错,你需要的在目标的最后的重写规则停止原被追加查询字符串。

If memory serves, you need the ? at the end of the target in the RewriteRule to stop the original query string being appended.

在code假设你没有得到任何其他参数(如果有,例如将无法正常工作 M = 1&安培;?富=酒吧)。

The code assumes you haven't got any other parameters (eg it won't work if you have ?m=1&foo=bar).

这篇关于除去刚刚"米等于1英寸;从使用的URL重写规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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