Welcome to WebmasterWorld Guest from

Forum Moderators: ocean10000

Message Too Old, No Replies

C# URL rewrite:example and/or best practices

8:49 pm on Jun 7, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 4, 2009
posts: 186
votes: 0

Hello all. This topic seems (to me) to have the potential to be relevant to multiple forums...or maybe I've posted in the wrong one to begin with! Bear with me...

I'm working on a project and will have a lot of product information stored in a database. To make the site dynamic (not having to add physical pages each time I add a product) I'm thinking of just having one page that is a general product page and it gets called something like this:


and all the page info will be filled displayed based on the id number.

However I would like the URL to show up as such:

or possibly use other fields in the DB to show up like this:

(not only show up in the address bar but be able to be accessed if somebody did a direct link to that.

I've never done this before but from a bit of looking around and what I've seen other places, I'm guessing this could be done. On an apache server I'm guessing a mod rewrite would do this but I'm on windows...so my questions are:

1) How do I do it (is it even done within the C# pages or elsewhere on the server?)
2) How does this affect SEO (either way...with the "clean" vs. "dirty" URL)


[edited by: marcel at 5:49 am (utc) on Jun 8, 2010]
[edit reason] examplified URLs [/edit]

9:46 pm on June 7, 2010 (gmt 0)

New User

10+ Year Member

joined:May 17, 2006
posts: 24
votes: 0


ASP.NET 4 has built-in URL Routing both for Web Forms and the MVC Framework.
Scott Guthrie has written an excellent blog post about it. You should google "scott guthrie url routing with asp.net web forms" and read the first article that pops up. It compares and contrast URL routing in both MVC and Web Forms in an easy to understand language. I think it will fill your needs.
5:48 am on June 8, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 1, 2005
votes: 0

In addition to what Dwarp9 says, IIS7.x also has a the IIS7 URL rewrite module [learn.iis.net] available to it.

This is what I usually use for my projects, if you need any example code let me know.

As far as any SEO benefits go, I think it helps a little, especially if you use the product name instead of its ID (ie. www.example.com/products/red/classic/phone-booth/) which will now give you a few keywords in the URL. But you could probably get more (and better) info of the SEO benefits in the Search Engine marketing [webmasterworld.com] forum.
12:35 pm on June 8, 2010 (gmt 0)

Junior Member

5+ Year Member

joined:Dec 4, 2009
votes: 0

Thanks guys. We are not on IIS7 but I've found the article and will read up on it. I appreciate it!

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members