mod_rewrite的后GET变量 [英] GET variable after mod_rewrite

查看:221
本文介绍了mod_rewrite的后GET变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组遵循以下规则htaccess的产品页面:

I have a set of product pages that obey the following htaccess rule:

RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_URI} ^/([0-9]+)\-(.+)\.html
RewriteRule ^(.*)$ /product/index.php?prod=%1-%2 [L]

这重写他们:example.com/123-1234.html

Which rewrites them to: example.com/123-1234.html.

我的问题是,我不能再通过额外的$ _GET变量的页面 - IE:example.com/123-1234.html?coupon=something123

My problem is that I can no longer pass additional $_GET variables to the page - IE: example.com/123-1234.html?coupon=something123.

有没有办法做到这一点?

Is there any way to do this?

推荐答案

您寻找QSA,查询字符串追加

Your looking for QSA, Query String Append

RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_URI} ^/([0-9]+)\-(.+)\.html
RewriteRule ^(.*)$ /product/index.php?prod=%1-%2 [L,QSA]

这篇关于mod_rewrite的后GET变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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