1

我有一个现成的 php 网站。对于那个网站,我正在app.yaml为谷歌应用引擎写作。我读了很多答案,但它对我没有帮助。我在文件夹中的各个子libraries文件夹下遇到 php 文件的问题。在index.php中,我通过调用其他 php 文件接受rss feed url并处理它以获取全文提要。但得到这个错误。

/makefulltextfeed.php?url=https%3A%2F%2Fnews.google.co.in%2Fnews%3Fpz%max
=10&links=preserve&exc=&submit=Create+Feed was not found on this server.

如何为app.yaml各种子文件夹下的所有php文件编写?我必须handlers:为所有单独的 php 文件编写吗?我被困在这里一整天。我是这个话题的新手。所以如果你觉得这是一个愚蠢的问题,请原谅我。这是我的 app.yaml

application: xxxx-xxxx-90212
version: alpha-001
runtime: php
api_version: 1

handlers:
- url: /
  script: index.php

- url: /config
  script: config.php

- url: /makefulltextfeed
  script: makefulltextfeed.php

- url: /css
  static_dir: css

- url: /js
  static_dir: css



- url: /images
  static_dir: images

我在子文件夹中有 php 文件。如何为此编写 app.yaml。

4

1 回答 1

3

如此处所述您可以使用此表示法将所有以 .php 结尾的根路径匹配到 php 脚本

# Serve php scripts.
- url: /(.+\.php)$
  script: \1

此配置假定您的每个 URL 都以 .php 结尾,您可以修改 url 正则表达式以捕获所有 URL(我只测试正则表达式,但我认为它是有效的 :))

# Serve ALL php scripts.
- url: /((.+\/).*)$
  script: \1.php

或者您可以按照此处所述模拟 httpd mod_rewrite 。

于 2015-04-02T13:33:06.593 回答