google-app-engine - 我在 GAE 中托管我的网站(php 文件)。app.yaml 文件没有路由我网站的页面。错误:未找到
问题描述
我的网站有8个页面,它是用php编写的:https : //interculture.appspot.com 在GAE中部署后,它可以加载和显示index.php页面。但是,当我单击其他链接时,不显示其他页面:错误:未找到此服务器上未找到请求的 URL /file.php。
这是我的文件的目录:蓝色突出显示的是我网站的页面。 在此处输入图像描述
这是我的 app.yaml 文件:
runtime: php72 </b>
handlers:
# Serve a directory as a static resource.
- url: /styles
static_dir: styles
# Serve images as static resources.
- url: /(.+\.(gif|png|jpg))$
static_files: \1
upload: .+\.(gif|png|jpg)$
# Serve your app through a front controller at index.php or public/index.php.
- url: /(.+\.php)$
static_files: static/\1
upload: /(.+\.php)$
# I add the "/" to url bellow as suggested but still get same error
- url: /.*
script: auto
secure: always
尽管它在浏览器中显示站点地址,但它显示:错误:未找到请求的 URL /file.php 在此服务器上未找到。
app.yaml 文件中缺少什么以正确路由到我网站的其他页面?
解决方案
您在 app.yaml 中的最终条目的 URL 应该是url: /.*
(带斜杠)。这是匹配的 URL 所必需的https://intercultural.appspot.com/*
。您可以在app.yaml 参考中看到一个示例。
推荐阅读
- c# - IAsyncEnumerable 之间有什么区别
vs IEnumerable >? - macos - XQuartz $DISPLAY 问题,无法在本地打开 xclock,无法 ssh -X
- node.js - multer和csrf保护
- laravel - Laravel Cashier - Stripe - 为客户设置首选语言环境
- r - 如何根据 Shiny R 中的用户选择在 MainPanel 中显示数据?
- python - Python 中最快的并行请求
- javascript - 如何使用 Babel 在 JavaScript 类中编写正确的私有方法?
- angular - 从 IntelliJ 运行 Angular 项目时看不到任何更改(html、css)
- salesforce - 在闪电中执行单个服务器调用而不是多个调用
- r - 将 ggplotly 与 ggplot 一起使用