<%@ WebHandler Language="VB" Class="MyNamespace.RobotsHandler" %> Imports System Imports System.Web Namespace MyNamespace Public Class RobotsHandler Implements IHttpHandler Public ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable Get ' Return false in case your Managed Handler cannot be reused for another request. ' Usually this would be false in case you have some state information preserved per request. Return False End Get End Property Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest ' Write your handler implementation here. context.Response.ContentType = "text/plain" context.Response.Write("User-agent: *" & vbCrLf) If (Context.Request.RawUrl.ToLower.Contains("test")) Then ' testing site Context.Response.Write("Disallow: /" & vbCrLf) Else ' production site Context.Response.Write("Allow: /" & vbCrLf) End If End Sub End Class End Namespace