Friendly Urls


https://forum.kartris.com/Topic3002.aspx
Print Topic | Close Window

By WithaG - Fri 2 May 2014
Quick question, how are the friendly urls achieved in Kartris 2.5? I'm new to .net routing as we currently use Isapi ReWrite on our own sites but I can't see anything in the web.config or global.asax that matches up with the little I know about .NET Friendly Urls

Thanks
By Paul - Fri 2 May 2014
Check the code in

App_code/Providers/SiteMapProvider.vb

This handles most reading and formatting of friendly URLs for the different page types.

There is also a little rewriting going on in the global.asax, for some special cases:

/admin -> /admin/Default.aspx (avoids an error if /admin used)

Also the callback page... normally you'd set a payment gateway to call back like this:

/Callback.aspx?g=Paypal

However, some payment systems which POST back don't like the querystring in the action URL, so you can instead use this format:

/callback-paypal.aspx

And it will map it to the parametrized callback URL. This way the callback page knows which gateway is calling it, but the URL doesn't look like it is passing GET information.

You can still use the url rewrite functionality of .net too for your own purposes. We've done this ourselves when we've built a Kartris site for a customer to replace another site. In that case, we can get a full list of URLs and then map them to the new Kartris URL equivalent, or at least do this for the most important products and categories.