This question is locked. New answers and comments are not allowed.
Please find our code for HTTP handler to handle classic asp request. However it request never gets processed.
public class AspRouteHandler : Telerik.Sitefinity.Web.PageRouteHandler
{
public IHttpHandler GetHttpHandler(RequestContext requestContext)
{
return new LegacyUrlHandler();
}
}
public class LegacyUrlHandler : IHttpHandler
{
private const string LegacyUrl = "index.asp";
private const string ReferringUrl = "ReferringUrl";
private const string RedirectUrl = "RedirectUrl";
public void ProcessRequest(HttpContext context)
{
if (!context.Request.RawUrl.ToLower().Contains(LegacyUrl))
{
return;
}
IQueryable<DynamicContent> entries =
Extensions.RetrieveCollectionOfModuleData(DynamicModulesPath.DynamicProvider(),
DynamicModulesPath.Custom404());
DynamicContent firstRow =
entries.FirstOrDefault(x => x.GetValue<string>(ReferringUrl) == context.Request.RawUrl);
if (firstRow == null)
{
return;
}
context.Response.Redirect(firstRow.GetValue(RedirectUrl).ToString());
}
public bool IsReusable
{
get { return true; }
}
}
-----------------------
Global.ascx changes
protected void Application_Start(object sender, EventArgs e)
{
Telerik.Sitefinity.Abstractions.Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized);
}
void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs args)
{
if (args.CommandName == "RegisterRoutes")
{
var routes = ((EnumerableQuery<System.Web.Routing.RouteBase>)args.Data).ToList<System.Web.Routing.RouteBase>();
System.Web.Routing.Route newRoute = new System.Web.Routing.Route("index.asp", new AspRouteHandler());
routes.Insert(0, newRoute);
}
}
----- web.config
<add verb="GET" path="*.asp" type="Qualico.Website.LegacyUrlHandler, Qualico.Website"/>
public class AspRouteHandler : Telerik.Sitefinity.Web.PageRouteHandler
{
public IHttpHandler GetHttpHandler(RequestContext requestContext)
{
return new LegacyUrlHandler();
}
}
public class LegacyUrlHandler : IHttpHandler
{
private const string LegacyUrl = "index.asp";
private const string ReferringUrl = "ReferringUrl";
private const string RedirectUrl = "RedirectUrl";
public void ProcessRequest(HttpContext context)
{
if (!context.Request.RawUrl.ToLower().Contains(LegacyUrl))
{
return;
}
IQueryable<DynamicContent> entries =
Extensions.RetrieveCollectionOfModuleData(DynamicModulesPath.DynamicProvider(),
DynamicModulesPath.Custom404());
DynamicContent firstRow =
entries.FirstOrDefault(x => x.GetValue<string>(ReferringUrl) == context.Request.RawUrl);
if (firstRow == null)
{
return;
}
context.Response.Redirect(firstRow.GetValue(RedirectUrl).ToString());
}
public bool IsReusable
{
get { return true; }
}
}
-----------------------
Global.ascx changes
protected void Application_Start(object sender, EventArgs e)
{
Telerik.Sitefinity.Abstractions.Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized);
}
void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs args)
{
if (args.CommandName == "RegisterRoutes")
{
var routes = ((EnumerableQuery<System.Web.Routing.RouteBase>)args.Data).ToList<System.Web.Routing.RouteBase>();
System.Web.Routing.Route newRoute = new System.Web.Routing.Route("index.asp", new AspRouteHandler());
routes.Insert(0, newRoute);
}
}
----- web.config
<add verb="GET" path="*.asp" type="Qualico.Website.LegacyUrlHandler, Qualico.Website"/>