Custom URL Routing at Site Root

Posted by Community Admin on 04-Aug-2018 13:51

Custom URL Routing at Site Root

All Replies

Posted by Community Admin on 14-Jul-2013 00:00

In my implementation of Sitefinity, I have a page with the URL "/user" configured to display the User Profile based on a provided user name. For example, http://mysite.com/user/user1 will display the user information the user with "user1".  

What I'd like to do is offer a simplified version of this URL at the root of my site by removing the middle "/user/" directory:
   


I'd like to do so while keeping in mind the following:
 - Still allow other pages configured at the root of my site to work (ex. ~/home, ~/login)
 - Do this dynamically for all users in the system (no maintaining of a static list of users somewhere)

Here is my thought process on how to accomplish the solution. I'm just having trouble figuring out what to use for the first step.
 1) Create some sort of HttpHandler / HttpModule/ other functionality to intercept the request and determine if the URL request contains just one part after the root domain.
 2) If above is met, parse the URL and do a quick query to see if the provided part (ex. user1) is a valid username in the system.
 3) If so, transfer to serve the content of the actual user page (ex. http://mysite.com/user/user1).

I have searched for many hours and tried many various solutions, some Sitefinity specific and others more general to IIS, but I haven't been able to situation.  I'm hoping someone else in the community has had this problem and can point me in the right direction or offer some advice.   Thanks!

Posted by Community Admin on 14-Jul-2013 00:00

This helper...

RouteHelper.SetUrlParametersResolve();
...will tell Sitefinity to not 404 a route

Not sure if you can use that or not though :)

Posted by Community Admin on 14-Jul-2013 00:00

Thanks for the info, though I still need to figure out a way for IIS/Sitefinity to even recognize the URL.  Right now it's currently using the StaticFileHandler and throwing a 404. I'm hoping has some code for an HttpHandler or HttpModule or custom Sitefinity Route that can be used to intercept the requests and determine if it's a valid username.

Posted by Community Admin on 29-Jan-2015 00:00

did you ever find a solution for this? I'm attempting to accomplish something similar, and cannot seem to prevent Sitefinity from throwing 404 instead of allowing me to intercept the route...

 

many thanks

Posted by Community Admin on 03-Feb-2015 00:00

Hello Josh,

This functionality is not available but I have logged it as Feature request in our Feedback portal, where you could vote for it and subscribe receiving notifications on status change.

Regards,
Svetoslav Manchev
Telerik

 
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 Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 04-May-2015 00:00

Hello,

 We just purchased Sitefinity and was told this was possible. Are you saying that it is currently not possible? What is the ETA for this feature if any? Is there any other possible work-arounds?

 We have an existing MVC based website that has user and branch pages. Our current routing set up allows any non-static pages to be intercepted and checked against a routing table to see if a user or branch page exists.

 Therefore, this user URL:

 http://academymortgage.com/kevinglad is found in the table and re-routed to academymortgage.com/.../kevinglad

 and this branch URL:

http://academymortgage.com/chandler is found in the table and re-routed to

academymortgage.com/.../chandler

 How can we accomplish this with the latest version of Sitifinity?

 Thanks,

Robert

 

Keywords: custom url routing, register routes, user profile pages

 

This thread is closed