【发布时间】:2021-03-25 00:28:39
【问题描述】:
为了在 PHP 代码中重定向,我在 GAE 上配置 app.yaml 时遇到了困难。在 index.php 中按下提交按钮后,我想重定向到thanks/thanks.html 目录中名为thanks.html 的另一个HTML 页面。但是,它使用当前设置从 index.php 重定向到 index.php。我认为 PHP 代码没有检测到我的 Thanks.html。所以我想问你我的 app.yaml 有什么问题,我应该使用 dispatch.yaml 吗?太感谢了 。除了重定向,其他功能都正常。
index.php(only the part of redirect to thanks.html)
header("Location: ./thanks/thanks.html");
exit();
app.yaml
runtime: php72
handlers:
- url: /(.*\.(gif|png|jpg))$
static_files: \1
upload: .+\.(gif|png|jpg)$
- url: /css
static_dir: css
- url: /js
static_dir: js
- url: .*
script: auto
http_headers:
- url: /thanks
static_dir: /thanks
env_variables:
SENDGRID_API_KEY: "*********"
DEVELOPER_EMAIL: "********"
【问题讨论】:
标签: php google-app-engine