<%@ WebHandler Language="C#" Class="AT.robotshandler" %> using System; using System.Web; namespace AT { public class robotshandler: IHttpHandler { public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/plain"; context.Response.Write("User-agent: *\n"); if (context.Request.ServerVariables["Https"]=="off") { // HTTP context.Response.Write("Sitemap: http://"+context.Request.Url.Host+"/GoogleSiteMap.axd\n"); context.Response.Write("Allow: /\n"); context.Response.Write("Disallow: /Admin/\n"); context.Response.Write("Disallow: /App_Browser/\n"); context.Response.Write("Disallow: /App_Code/\n"); context.Response.Write("Disallow: /App_Data/\n"); context.Response.Write("Disallow: /App_GlobalResources/\n"); context.Response.Write("Disallow: /bin/\n"); context.Response.Write("Disallow: /Components/\n"); context.Response.Write("Disallow: /Config/\n"); context.Response.Write("Disallow: /Controls/\n"); context.Response.Write("Disallow: /DesktopModules/\n"); context.Response.Write("Disallow: /Documentation/\n"); context.Response.Write("Disallow: /Install/\n"); context.Response.Write("Disallow: /js/\n"); context.Response.Write("Disallow: /Providers/\n"); context.Response.Write("Disallow: /Resources/\n"); context.Response.Write("Disallow: /*/ctl/\n"); context.Response.Write("Disallow: /*/Login/\n"); context.Response.Write("Disallow: /*/Register/\n"); context.Response.Write("Disallow: /*/Privacy/\n"); context.Response.Write("Disallow: /*/Terms/\n"); context.Response.Write("Disallow: /ctl*/\n"); context.Response.Write("Disallow: /Login*/\n"); context.Response.Write("Disallow: /Register*/\n"); context.Response.Write("Disallow: /Privacy*/\n"); context.Response.Write("Disallow: /Terms*/\n"); context.Response.Write("Disallow: /*?\n"); context.Response.Write("Disallow: /ADM/\n"); context.Response.Write("Disallow: /Blog/\n"); } else { // HTTPS context.Response.Write("Disallow: /"); } } public bool IsReusable { get {return false;} } } }