帮助理解为什么这个重写不起作用?
我有这样的:
RewriteRule ^show_shop/([0-9]+)$ show_shop.php?id=$1 [NC]
当输入这样的网址时:“domain.com/show_shop/4”然后获取网址,并显示“show_shop.php”。所以重写是有效的。
但是,斜杠后面的 nr 不起作用。我使用这段代码:
$id = $_GET['id'];
但它的结果是空白,即什么都没有。不是按照php设置的。
这可能是什么原因造成的。
仅供参考,我有很多像这样的其他规则,它们工作正常,但是这个似乎很麻烦...
像这样的“show_shop.php?id=4”手动输入 URL(真实的 url)工作正常,并且id 是 GET,一切都很好。
有什么想法吗?
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 slash 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试 QSA 标志
Try the QSA-Flag
不应该是 % 而不是 $
Shouldn't it be % rather than $