Apache RewriteRule:保留查询字符串并添加新参数

发布于 2024-09-13 21:05:40 字数 390 浏览 2 评论 0原文

我不确定这是否是我试图解决的错误的根源,但是,我仍然不确定我是否正确理解了 Apache 文档...

假设我想重定向

toto.page?a=2&c=546EUE&stuff=blah

index.page?view=Blahblah/Toto&a=2&c=546EUE&stuff=blah

当然,如果还有其他参数,它们也应该被保留。

下面的规则正确吗?

RewriteRule ^toto\.page$    index.page?view=Blahblah/Toto     [NC,QSA,L]

I'm not sure whether this is the origin of the bug I'm trying to solve, however, I'm still not sure I correctly understood Apache doc...

Let's say I wanna redirect

toto.page?a=2&c=546EUE&stuff=blah

to

index.page?view=Blahblah/Toto&a=2&c=546EUE&stuff=blah

Of course, if there was other parameters, they should be preserved too.

Is the following rule correct?

RewriteRule ^toto\.page$    index.page?view=Blahblah/Toto     [NC,QSA,L]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傲性难收 2024-09-20 21:05:40

是的。这是正确的。

Yes. That is correct.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文