Eran Betzalel
Eran Betzalel

Reputation: 4203

How to stop google bot requests to a web service (ASMX)?

I have a JSON-based WS for my website and I get a non-stop requests by Google Bot to my ASMX file.

How can I stop these requests?

Note: I tried reading about it here, but it doesn't seem to supply any elegant solution for WS.

Here is the exception I get /w HTTP request:

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)

Upvotes: 0

Views: 1103

Answers (2)

Sujay
Sujay

Reputation: 2196

Robots.txt can be used to disallow most bots from accessing specific actions from your website. Google has a support page for this.
Take a look at it to be able to configure your server as you wish.
The Generate tool is useful in most cases. check it out.

Upvotes: 0

Adrian Serafin
Adrian Serafin

Reputation: 7715

Have you considered using robots.txt file?

Upvotes: 2

Related Questions