<%@ WebHandler Language="C#" Class="MyNamespace.robotshandler" %> using System; using System.Web; namespace MyNamespace { 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("Allow: /\n"); context.Response.Write("Disallow: /Enterprise/\n"); context.Response.Write("Disallow: /Devlounge/\n"); context.Response.Write("Disallow: /new-horizons-toronto/\n"); context.Response.Write("Disallow: /Search/\n"); context.Response.Write("Disallow: /_layouts/\n"); context.Response.Write("Disallow: /ReusableContent/\n"); context.Response.Write("Disallow: /Reports%20List/\n"); context.Response.Write("Disallow: /WorkflowTasks/\n"); context.Response.Write("Disallow: /SiteCollectionDocuments/\n"); context.Response.Write("Disallow: /SiteCollectionImages/\n"); context.Response.Write("Disallow: /Documents/Forms/\n"); context.Response.Write("Disallow: /Pages/Forms/\n"); context.Response.Write("sitemap: http://www.objectsharp.com/sitemap.xml\n"); } else { // HTTPS context.Response.Write("Disallow: /"); } } public bool IsReusable { get {return false;} } } }