You can do it by checking the url scheme, using the Request.Url.Scheme.
public void Init(HttpApplication application)
{
application.BeginRequest += new EventHandler(application_BeginRequest);
}
protected void application_BeginRequest(object sender, EventArgs e)
{
HttpApplication application = ((HttpApplication)(sender));
HttpRequest request = application.Request;
if (request.Url.Schema == "http://" || "https://")
{
Response.Redirect(request.Url);
}
}