我如何使用mod_rewrite后,除去一切? (问号)的网址是什么? [英] How can I use mod_rewrite to remove everything after the ? (question mark) in a URL?
本文介绍了我如何使用mod_rewrite后,除去一切? (问号)的网址是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何使用mod_rewrite后,除去一切? (问号)的网址是什么?
How can I use mod_rewrite to remove everything after the ? (question mark) in a URL?
例如:
的http:// 127.0.0.1/ALL_FILES.php?test=1
后mod_rewrite的:
after mod_rewrite:
http:// 127.0.0.1/ALL_FILES.php
有关PHP这意味着$ _GET超级全局永远是空的系统上的所有文件。
For php this means that the $_GET super global will always be empty for all files on the system.
感谢您。
推荐答案
下面的规则应该照顾它(为的您网站上的所有的网址,如前所述):
The following rule should take care of it (for all URLs on your site, as mentioned):
RewriteCond %{QUERY_STRING} .+
RewriteRule ^(.*)$ /$1? [R=301,L]
我必须承认我有点好奇,为什么你想做到这一点...我不认为它有很大的SEO的价值,你可以只忽略 $ _ GET
你的脚本里面的变量?
这篇关于我如何使用mod_rewrite后,除去一切? (问号)的网址是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文