开发者

Help with understanding why this rewrite doesn't work?

开发者 https://www.devze.com 2023-01-26 07:48 出处:网络
I have this: RewriteRule ^show_shop/([0-9]+)$ show_shop.php?id=$1 [NC] When entering the url like this: \"domain.com/show_shop/4\" then the url is fetched, and \"show_shop.php\" is displayed. So t

I have this:

 RewriteRule ^show_shop/([0-9]+)$ show_shop.php?id=$1 [NC]

When entering the url like this: "domain.com/show_shop/4" then the url is fetched, and "show_shop.php" is displayed. So the rewrite kindof works.

However, the nr behind the sla开发者_StackOverflow社区sh doesnt work. I use this code:

  $id = $_GET['id'];

but it results in blank, ie nothing is there. It isn't set according to php.

What could be the cause of this.

FYI I have plenty of other rules just like this, and they work fine, but this one seems to be troublesome...

Entering the URL manually (the real url) like this "show_shop.php?id=4" works fine, and the id is GET and all is fine.

Any ideas?


Try the QSA-Flag

RewriteRule ^show_shop/([0-9]+)$ show_shop.php?id=$1 [NC,QSA]


Shouldn't it be % rather than $

RewriteRule ^show_shop/([0-9]+)$ show_shop.php?id=%1 [NC]
0

精彩评论

暂无评论...
验证码 换一张
取 消