Friendly Urls iis and Orchard

Topics: General, Troubleshooting
Apr 17, 2012 at 2:17 PM

I have been trying to use the Url-Rewrite module in IIS to give friendly urls to orchard where urls are like domain.com/blog?page=2 to domain.com/blog/2

The module gives you the option to create a outbound rukle to convery all your internal links to the new friendly url

but when i go to the blog, the urls come up as domain.com/blog/blog/2 it seems like Orchard is injecting blog/ 

can anybody shed some light on this?

THanks

Coordinator
Apr 17, 2012 at 10:59 PM

Why would you use URL Rewrite for this? What's wrong with Autoroute?

Apr 17, 2012 at 11:30 PM

Thanks for your reply, I have had a look at Autoroute, but could not work out how to apply this in this situation, I am not sure what part to appy it to or what pattern to select, do you have any hints,

thanks

Coordinator
Apr 17, 2012 at 11:31 PM

Look at existing patterns for existing content types.

Apr 18, 2012 at 12:00 AM

I have done that, but can not find a pattern in the list to repersent page. Maybe i just dont follow. I am familier with routing in MVC where i could have page as a integer, but at a loss as to how to impliment it here.

Thanks

Coordinator
Apr 18, 2012 at 12:32 AM

Ah, I missed the part about the page number. In that case I would create a new route with a higher priority than the one already existing.

Apr 18, 2012 at 3:45 AM

Thanks Bertrand, but i can not seem to work out what pattern i should be entering, or even what part i should be editing.

Thanks

Coordinator
Apr 18, 2012 at 4:27 AM

There are plenty of examples of route declaration in existing modules. Look them up.

Apr 18, 2012 at 5:12 AM
Edited Apr 18, 2012 at 5:13 AM

i could not find any using page numbers, but was able to do what i wanted using IIS outbound rules

Coordinator
Apr 18, 2012 at 5:53 AM

I did not say you'd find one with the exact specific code that you need (otherwise you wouldn't have anything to do). I'm trying to steer you to places where you can find similar stuff, so that you can learn how to do it. A page number is just a parameter. I don't think there should be any difference.