Click here to Skip to main content
15,889,403 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need an urgent idea/ how to create sub-domain for each city who is store in my website.

For eg) I hosted my application in www.xyz.com
If a city name "pune" is my website.
I need to create a site for the user as "pune.xyz.com"

In simple words how to rewrite the url for each city ??
Posted

1 solution

I don't think what you're trying to do is possible.

IIS 7 does not support wild cards for host entries. The host entry is what links the request to a specific server root.

http://stackoverflow.com/questions/458757/wildcard-subdomains-in-iis7-is-it-possible-to-make-them-like-it-is-in-apache[^]

You can manually add host entries for each city you want to support.

My advice would be a tradition url rewrite so that you can support:

www.xyz.com/pune
www.xyz.com/london

http://stackoverflow.com/questions/458757/wildcard-subdomains-in-iis7-is-it-possible-to-make-them-like-it-is-in-apache[^]
 
Share this answer
 
Comments
Yogesh_Chavan 15-Jun-13 5:10am    
thanks Stephen Hewison but subdomains are managed programmitically ....

give me the advice
Ashish Rathod-.Net Developer 6-Feb-14 1:48am    
Hy yogesh ...

I have to survive that issue so please if u have to solve this issue please let me know.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900