Try our conversational search powered by Generative AI!

Url Segment Removal By page id

Vote:
 

Hi All,

I am new to EPiServer CMS, I need to remove the page segment of the url by the page id. 

For example say, If i have an url of a page like this "sitename.com/en/Home/Events/About". I need to remove the segment "Events" by its page id on that url but the landing page must be the same.

I have tried it using the IPartialRouter interface, But I think it was pagetype specific. I need this segment removal functionality to work on the entire site, When ever the url has the segment "Events" on it , it should be removed from the url.

I dont know if this requirement is possible or not.

Can anybody help me.

#142647
Dec 17, 2015 12:51
Vote:
 

Hello!

I think the way to go here is to use the IPartialRouter interface, like you have tried. In order to do it you should have a base class for you page types, and then you can pass it to the generic parameters of the interface and it should work on the entire website.  More details on how to do this here http://joelabrahamsson.com/custom-routing-for-episerver-content/

See also http://www.mogul.com/en/about-mogul/blog/registering-a-route-with-an-optional-action-segment-in-episerver-75-and-on

/Kenia

#142731
Dec 21, 2015 13:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.