AppEngine Java中的Robots.txt

JR *_*lia 4 java google-app-engine robots.txt

我有一个Java AppEngine Web应用程序.我注意到在appengine的管理控制台的仪表板中,每天都会遇到URI错误/robots.txt.

如何删除错误?

ono*_*n15 14

robots.txt是处理您网站之前搜索引擎和其他漫游器使用的神奇网址.有关详细信息,请参阅维基百科.

在GAE上处理此错误的最佳方法是放置一个robots.txt文件,并将其定义为app.yamlfor gae/python中的静态文件:

- url: /(robots\.txt)
  static_files: \1
  upload: (robots\.txt)
Run Code Online (Sandbox Code Playgroud)

appengine-web.xmlgae/java中:

<?xml version="1.0" encoding="UTF-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0"
                   xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'           xsi:schemaLocation='http://kenai.com/projects/nbappengine/downloads/download/schema/appengine-web.xsd appengine-web.xsd'>
    ....
    <static-files>
        <include path="/favicon.ico" />
        <include path="/robots.txt" />
        <include path="/img/**.png" />
        <include path="/img/**.gif" />
        <include path="/css/**.css" />
</static-files>
Run Code Online (Sandbox Code Playgroud)

当然,您也可以忽略这些错误,除了您自己之外,它们对任何人都无关紧要(没有人遇到错误).