Apache 重写到 Nginx 重写
我有以下 apache 重写规则:
RewriteEngine On
RewriteRule ^id/([^/\.]+)$ item.php?id=$1 [L]
并且我需要能够将它与 Nginx 一起使用。其目的是让某人可以访问 http://mysite.com/id/10必须去 http://mysite.com/item.php?id=10。 谁能帮我转换一下吗?
提前致谢!
I have the following apache rewrite rule:
RewriteEngine On
RewriteRule ^id/([^/\.]+)$ item.php?id=$1 [L]
and I need to be able to use it with Nginx. It is meant to so that someone can go to http://mysite.com/id/10 and instead of having to be go http://mysite.com/item.php?id=10.
Can anyone help me convert it?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的意思是这样的:
you mean like this:
这应该可以解决问题:
This should do the trick: