url rewriting rules in episerver

Vote:
 

Hi,

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

#46299
Dec 07, 2010 8:21
Vote:
 

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

#46303
Dec 07, 2010 9:33
Vote:
 

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.

http://tedgustaf.com/en/blog/2008/7/create-a-custom-url-rewrite-provider-for-episerver/

Cheers!

#46304
Dec 07, 2010 9:48
Vote:
 

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.

#46306
Dec 07, 2010 10:06
Vote:
 

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

#46307
Dec 07, 2010 10:08
Vote:
 

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: http://msdn.microsoft.com/en-us/library/ms972974.aspx.

#46309
Dec 07, 2010 10:16
Vote:
 

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.

#117062
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.