首页 > 解决方案 > Google 在 PHP 应用引擎中未找到 Robots.txt

问题描述

Googlebot似乎robots.txt没有找到我的文件,因为我不断收到 404 错误Stack Logger

我的应用程序结构如下:

/www
    - index.html
    - sendMessage.php
app.yaml
robots.txt

这是我的app.yaml文件:

runtime: php55
service: default
api_version: 1
threadsafe: true
automatic_scaling:
   min_idle_instances: 1
instance_class: F4_1G

handlers:
- url: /sendMessage.php
  script: sendMessage.php
  secure: always 

- url: /
 static_files: www/index.html
 upload: www/index.html
 secure: always

- url: /robots.txt
  static_files: robots.txt
  upload: robots.txt

- url: /(.*)
static_files: www/\1
upload: www/(.*)
secure: always

然后我的robots.txt文件是:

# Rule 1
User-agent: Googlebot
Disallow: /nogooglebot/

# Rule 2
User-agent: *
Allow: /

任何帮助将不胜感激!谢谢 :)

标签: phpgoogle-app-engineyamlrobots.txt

解决方案


推荐阅读