我怎样才能转发查询字符串使用htaccess的? [英] How can I forward a query string using htaccess?

查看:155
本文介绍了我怎样才能转发查询字符串使用htaccess的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的这个,在present,重写URL:

I am using this, at present, to rewrite URLS:

RewriteEngine on
RewriteRule ^([^/?\.]+)$ /page.php?name=$1 [NC]

所以 mysite.com/home 被改写为 mysite.com/page.php?name=home

我怎样才能使它也重写 mysite.com/home?param=value mysite.com/page.php?name=home& ;参数=值?理想情况下,我想这适用于任何名称/值查询字符串对。

How can I make it also rewrite mysite.com/home?param=value to mysite.com/page.php?name=home&param=value? Ideally, I'd like this to work for any name/value querystring pairs.

我失去了一些东西明显?

Am I missing something obvious?

推荐答案

查阅获取变量部分的 http://corz.org/serv/tricks/htaccess2.php

它说,如果你添加[QSA]将重写规则的最后,应通过改写传递变量

It says that if you add [QSA] to the end of the rewrite rule, it should pass variables through the rewrite.

这篇关于我怎样才能转发查询字符串使用htaccess的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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