Take the 2-minute tour ×

What's the best approach to provide URL handling in an ASP.NET application to produce results similar to Craigslist. Specifically, I'm looking to handle something like "newyork.mysite.com" and "california.mysite.com", along with parameters such as "newyork.mysite.com/products/hardware". Based on the "location" (newyork.), my goal is to change the site's look and feel and filter it's data results -- standard stuff I would think.

At the moment, ASP.NET MVC is not an option for the site (from what I've read, this sort of functionality is something that MVC excels at), but I can use .NET 4.0. Also, I was wondering what roles DNS would play in this scenario. Is the subdomain just a wildcard or are there any special considerations I would need to make?

The majority of my web development experience has been internal, intranet applications, so URL handling like this is not something I've ever really needed to do. I'd appreciate any advice (best practices, pitfalls, etc) as to how to approach this.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You can avail of the ASP.NET 4.0 routing engine to create friendly URLs:


You can create URLs like:




As regards "california.mysite.com", the "california" part represents a sub-domain. This is set up by adding an A record in your host admin and setting up IIS 7 to recognize it.

share|improve this answer
If you are using .NET 3.5 SP1 (instead of .NET 4.0) then you may find this article helpful: msdn.microsoft.com/en-us/magazine/dd347546.aspx –  Scott Mitchell Sep 19 '10 at 16:32
add comment

Your Answer


