【问题标题】:How to stop google bot requests to a web service (ASMX)?如何停止谷歌机器人对网络服务(ASMX)的请求?
【发布时间】:2011-02-20 12:25:31
【问题描述】:

我的网站有一个基于 JSON 的 WS,我收到 Google Bot 对我的 ASMX 文件的不间断请求。

如何停止这些请求?

注意:我尝试阅读它here,但它似乎没有为 WS 提供任何优雅的解决方案。

这是我收到 /w HTTP 请求的异常:

Logged date (UTC):  20/02/2011 12:00:59
Requested URL:      https://dynamic-subdomain.somedomain.com/ExternalApi/Rest/RateServices.asmx/GetRate

A general error has occured.

Exception:
System.InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/GetRate'.
   at System.Web.Services.Protocols.WebServiceHandlerFactory.CoreGetHandler(Type type, HttpContext context, HttpRequest request, HttpResponse response)
   at System.Web.Services.Protocols.WebServiceHandlerFactory.GetHandler(HttpContext context, String verb, String url, String filePath)
   at System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated)
   at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
   at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

HTTP Request:
GET /ExternalApi/Rest/RateServices.asmx/GetRate HTTP/1.1
Connection: Keep-alive
Accept: */*
Accept-Encoding: gzip,deflate
From: googlebot(at)googlebot.com
Host: dynamic-subdomain.somedomain.com
User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)

【问题讨论】:

    标签: asp.net web-services json googlebot


    【解决方案1】:

    您是否考虑过使用 robots.txt 文件?

    【讨论】:

    • 哈,这么简单,我不小心认为它不适合我的情况,因为动态子域。
    【解决方案2】:

    Robots.txt 可用于禁止大多数机器人从您的网站访问特定操作。 谷歌为此提供支持page
    看看它,以便能够根据需要配置您的服务器。
    生成工具在大多数情况下都很有用。看看吧。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-09
      • 1970-01-01
      • 2011-07-19
      • 1970-01-01
      • 1970-01-01
      • 2018-04-16
      • 1970-01-01
      • 2023-01-09
      相关资源
      最近更新 更多