从以下网址了解更多的.htaccess删除参数 [英] Remove parameter from URL viac .htaccess
本文介绍了从以下网址了解更多的.htaccess删除参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要建议如何从使用URL删除参数。 Htcaccess
I need advice how to remove a parameter from the url using. Htcaccess
的条件如下:
重定向URL的:
http://example.com/?movie=2&ref=nf
到
http://example.com/?movie=2
我尝试了几种选择,但我还没有落空
I tried several options but I have not come to nothing
感谢您的意见/建议。
THX。
推荐答案
尝试添加以下到您的网站的根目录下的的.htaccess
文件。
Try adding the following to the .htaccess
file in the root directory of your site.
RewriteEngine on
RewriteBase /
#If request contains ref param
RewriteCond %{THE_REQUEST} \?([^&\ ]+)&ref= [NC]
#redirect to URL without the ref param
RewriteRule ^ %{REQUEST_URI}?%1 [L,R=301]
这篇关于从以下网址了解更多的.htaccess删除参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文