Catch all route and Backend routes

Posted by Community Admin on 03-Aug-2018 13:57

Catch all route and Backend routes

All Replies

Posted by Community Admin on 11-Aug-2011 00:00

Hi there,

I'm using Sitefinity 4.1 SP2.

I'm trying to use a catch all handler to return my custom 404 pages for all non-existent routes. However, i need to set RouteExistingFiles to false (cassini fails instantly, this only works under IIS (and express)) to get my css, javascript and image files.

routes.MapPageRoute("NotFound", "*url", Config.ErrorPageUrl);
routes.RouteExistingFiles = false;

My backend is unreachable though. It returns a white page which only shows an empty head and body block.

I can see a BackendRoute defined in the route collection, but apparently it does not create or handle all backend url's because the handler doesn't figure out it's bound to the backend.

Any ideas on how to fix this?

Posted by Community Admin on 15-Aug-2011 00:00

Hi Rick De Vries,

Can you please check if your rule is catching the requests for services also? The whole backend is populated with data by services. Is it possible that their execution is failing for some reason?

All the best,
Radoslav Georgiev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 16-Aug-2011 00:00

Hi,

I've excluded some paths/resources from routing, it still returns a blank page ( I viewed the page source and it contains absolutely no data)

What I discovered is that the default redirects from the sitefinity/ (to login or the default page) directory do not get fired, and the blank response is returned. If I supply the url with the location i want to go to (sitefinity/Login or sitefinity/Pages) it goes to the sitefinity pages.

How can I fix this?

Posted by Community Admin on 16-Aug-2011 00:00

I've finally fixed this. Because i had routeExistingPages set to false, it recognized the directory as being a file and decided not to act upon it. I removed the line and now it works.

This thread is closed