Mod_rewrite处理额外的获取变量(QSA不起作用) [英] Mod_rewrite handling extra get variables (QSA not working)

查看:86
本文介绍了Mod_rewrite处理额外的获取变量(QSA不起作用)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对设置页面有一个mod重写规则:(localhost/settings/index.php)

I have a mod rewrite rule for settings page: (localhost/settings/index.php)

RewriteRule settings/([a-zA-Z0-9_]+)/?$ settings/?path=$1 [QSA,L]

我正在处理URL中的菜单引用,该引用类似于:

And I am handling menu references within the URL which will be similar to:

http://localhost/settings/xyz/?ref=menu1&abc=2&de=3..

但是,按照我当前的重写规则,该变量不会传递,并且我也没有获得ref,abc的值.

However, with my current rewrite rule, the variable does not get passed along and I didn't get the values of ref,abc..

我在此处中阅读了有关QSA标志的信息,但事实并非如此.似乎没有用.

I read here about QSA flag but that doesn't seem to be working.

我在做什么错了?

推荐答案

尝试关闭MultiViews选项:

Options -MultiViews
RewriteEngine On

RewriteRule ^settings/([\w-]+)/?$ settings/?path=$1 [QSA,L,NC]


代替QSA,您可以使用此技巧来捕获查询字符串:


In place of QSA, you can use this trick to captured query string:

RewriteRule ^settings/([\w-]+)/?$ settings/?path=$1&%{QUERY_STRING} [L,NC]

这篇关于Mod_rewrite处理额外的获取变量(QSA不起作用)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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