【发布时间】:2014-11-03 07:53:23
【问题描述】:
我有一个旧的 Web 应用程序,它使用 get.php 与客户端应用程序交互。现在我们升级了我们的 web 应用程序以使用 laravel 框架,它使用 restful api 作为 url 接口,
我们的服务器使用 nginx,所以我想将旧 url 重定向到新 url,如下所示:
/get.php?update => /update or (index.php/update)
我已经尝试过这些配置。
location = /get.php?update {
try_files $uri $uri/ /index.php/update;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
但似乎当我访问get.php 时,我仍然得到404 error。
那么如何使用 nginx 的重写来重定向它呢?
【问题讨论】: