How customize 'Thank you for visiting our web site.'

Posted by Community Admin on 03-Aug-2018 11:30

How customize 'Thank you for visiting our web site.' Page

All Replies

Posted by Community Admin on 24-Dec-2010 00:00

I would like to know if I can redirect to a static html page when the site is showing 'Thank you for visiting our web site.' This happens to anonymous users because I have restricted all pages access to backendusers.
Thank you

Posted by Community Admin on 24-Dec-2010 00:00

Hi Vincent,

Currently it is hard to redirect from the under construction page. We need to implement 403 response when someone tries to access a page with no permissions, but now you get page not found and you are redirected to the under construction page.

To change the under construction page you can try the following

1. Crate a new class that inherits from SitefinityRoute.
2. Override GetRouteData and before calling the base check the current request and return

var siteMapProvider = SitefinitySiteMap.GetCurrentProvider();
string virtualPath = httpContext.Request.AppRelativeCurrentExecutionFilePath.Substring(2) + httpContext.Request.PathInfo;
var unresolvedPath = ObjectFactory.Resolve<UrlLocalizationService>().UnResolveUrlAndApplyDetectedCultures(virtualPath);
  var node = siteMapProvider.FindSiteMapNode(unresolvedPath);
if(node == null)
 return new RouteData(this, new UnderConstructionRouteHandlerCustom());
base.GetRouteData(httpContext)

3. Create a custom class UnderConstructionRouteHandlerCustom that inherits from UnderConstructionRouteHandler and there override GetTemplateInfo where you can return your custom template

4. Finally initialize your custom route

protected void Application_Start(object sender, EventArgs e)
       
           Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(this.AfterInit);
        
       
 
       private void AfterInit(object sender, ExecutedEventArgs args)
       
         
           RouteCollection c = new RouteCollection();
           c.Add("Frontend", ObjectFactory.Resolve<SitefinityRouteCustom>());      
       


All the best,
Ivan Dimitrov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed