为什么这个 URL 重写不起作用?
这是“真正的”链接:
domain.com/show_shop.php?id=4
这是重写的:
domain.com/show_shop/4
我使用后者,因为我的 .htaccess 中有这个:
RewriteRule ^show_shop/([0-9_]+)$ show_shop.php?id=$1 [NC]
但由于某种原因它不起作用。这个重写不会给出我想要的吗?
谢谢
编辑:
RewriteRule ^new_ad$ new_ad.php [NC] // WORKS FINE!
RewriteRule ^kategori/([0-9_]+)/([0-9]+)$ browse_cat.php?cat_gr=$1&p=$2 // WORKS FINE!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试:
另外,如果可能的话,如果您在 VirtualHost 中打开这些功能,您可以看到所发生情况的日志:
Try:
Also, if possible, you can see the log of what's happening if you turn these on in your VirtualHost:
如果调用了 show_shop 但未设置 URL 参数,则可能是由于 多视图。尝试禁用它。
If show_shop is called but the URL parameter is not set, it could be due to MultiViews. Try to disable it.