【问题标题】:nginx rewrite file locationnginx重写文件位置
【发布时间】:2012-07-23 08:37:07
【问题描述】:

在我的应用程序中,我试图将http://domain.com/accounts/login 和/accounts/register 链接到http://domain.com/accounts.php?action=$,其中$ 是:http://domain.com/accounts/$

我不知道在哪里定义重写以及放下什么。

我可以通过 SSH 访问整个 VPS,但我不确定要编辑哪个文件。那么文件在哪里呢?

我检查了 /opt/ 文件夹,它似乎是空的。我可能正在运行 lighttpd,所以你能帮我解决这两种情况吗?否则,你能告诉我如何检查我是否使用了lighttpd。

【问题讨论】:

  • 哦,该文件将在您的conf 目录中,无论您的 Nginx 安装在哪里。如果找不到,请尝试find / -name nginx。
  • 谢谢,我的特定域 nginx conf 位于 /etc/nginx/enabled-sites/

标签: php nginx rewrite directory lighttpd


【解决方案1】:
rewrite /accounts/(login|register) /accounts.php?action=$1

应该可以解决问题。把它放在你的server(或location)指令中。

【讨论】:

    猜你喜欢
    • 2014-12-06
    • 2019-01-08
    • 2016-02-14
    • 2012-04-16
    • 2016-05-30
    • 1970-01-01
    • 2010-12-21
    • 2013-12-16
    • 1970-01-01
    相关资源
    最近更新 更多