【问题标题】:google Gae php: Custom Not Found Urlgoogle Gae php:未找到自定义网址
【发布时间】:2013-06-26 14:12:14
【问题描述】:

我正在使用谷歌应用引擎上传我的 php 文件。 例如这是我的测试 url http://testing12399234.appspot.com/index.php ,每当找不到该 url 时,我希望页面指向 http://testing12399234.appspot.com/index.php ,例如访问 http://testing12399234.appspot.com/randomblabla12312 必须显示 http://testing12399234.appspot.com/index.php 的内容。我知道它可能通过 .htaccess 。但是如何在谷歌 GAE 中使用 .htaac​​cess

【问题讨论】:

    标签: google-app-engine


    【解决方案1】:

    app.yaml 文件包含应用程序的处理程序。与请求的 URL 匹配的第一个处理程序用于为请求提供服务。在链接的文档中,最后一个处理程序是:

    - url: /.*
      script: not_found.php
    

    因此,这将匹配任何尚未匹配的 URL,并将其发送到您的自定义未找到页面。只需确保它是配置文件中的最后一个处理程序,否则它将优先于其他处理程序。

    Google AppEngine PHP AppConfig documentation

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-10-19
      • 2018-07-04
      • 1970-01-01
      • 1970-01-01
      • 2011-02-15
      • 1970-01-01
      • 1970-01-01
      • 2015-06-04
      相关资源
      最近更新 更多