【发布时间】:2019-04-18 03:17:23
【问题描述】:
在这里网络化菜鸟。
我目前正在迁移旧的 Ruby on Rails 应用程序,以便将 Netlify 用于静态站点。我们希望在旧代码库中保留一些旧版静态页面,这些旧版静态页面向我们的服务器发出 POST 请求。
似乎无法重定向 POST 请求(请参阅W3 documentation for 301/302 redirects-If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.),但我想知道当您代理/重写 URL 时这是否有所不同。
目前,我们通过 Netlify 的 splat 重定向将用户的请求重写为 www.domain.com/legacy_slug(类似于 this blog post 的作者所做的)。当用户向www.domain.com 发送 POST 请求时,此重定向是否也可以正常工作,导致它转到 Netlify?还是我必须将客户端的代码更改为 POST 到 <different_subdomain>.domain.com/legacy_slug 并将 POST 端点迁移到不同的子域?
【问题讨论】:
标签: netlify netlify-cms