Try our conversational search powered by Generative AI!

url rewriting rules in episerver



I need to set rules in the url rewriting in my web application . One example would be, I need to show only the .aspx extention and hide the page id and language. How do I do that? Please help

Dec 07, 2010 8:21

Sounds like you need to write an own url rewrite provider.

Dec 07, 2010 9:33

Hi Abisanka,

Could you give a bit more background as to why you're doing your own url rewriting? EPiServer supports friendly URL rewriting out of the box. e.g. it hides both aspx, language and page ID.

You have a section in episerver.config called <urlRewrite>. Default provider should be EPiServerFriendlyUrlRewriteProvider.

But if you need a custom implementation then a good place to start would be Ted Nyberg's post on how to implement a custom URL rewrite provider. I'm sure you could tweak it to suit your needs.


Dec 07, 2010 9:48

Hello Daniel,

This is indeed a custom requirement of the application that the url will only show the extension of the page and hide the pageid as well as language.

Dec 07, 2010 10:06

Is there anyway we can do it using regular expressions in web.config ??

Dec 07, 2010 10:08

I think you'd have to implement your own URL rewriting engine if you want to use regular expressions.

Without knowing exactly how the functionality will be implemented in your application I'd recommend you start over at MSDN where they have more information on the subject.

There's an article of how to implement an URL rewriter using either HttpModule or HttpHandler together with regex here:

Dec 07, 2010 10:16

Is there a way to hide the container foldername (Page in tree structure just holding child pages) from the URL in EPiServer CMS 6 R2.

Edited, Feb 11, 2015 4:05
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.