Reputation: 2842
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.
Upvotes: 0
Views: 163
Reputation: 15253
You can avail of the ASP.NET 4.0 routing engine to create friendly URLs:
You can create URLs like:
california.mysite.com/home
california.mysite.com/about
california.mysite.com/products
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.
Upvotes: 1