Help with understanding why this rewrite doesn't work?
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]
精彩评论