Asp.net:为每个城市创建一个子域名 [英] Asp.net : create a subdomain for each city

查看:83
本文介绍了Asp.net:为每个城市创建一个子域名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我需要一个紧急的想法/如何为我网站上存储的每个城市创建子域名。



例如)我在www.xyz.com上托管我的申请

如果城市名称pune是我的网站。

我需要为用户创建一个网站pune.xyz.com



简单来说,如何重写每个城市的网址?

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 ??

推荐答案

我不认为你想做的事情是可能的。



IIS 7不支持通配符对于主机条目。主机条目是将请求链接到特定服务器根目录。



http://stackoverflow.com/questions/458757/wildcard-subdomains-in-iis7-is-它可能让它们变得像在阿帕奇一样...... [ ^ ]



您可以手动为每个要支持的城市添加主机条目。



我的建议是传统的网址重写,以便您可以支持:< br $>


www.xyz.com/pune

www.xyz.com/london



http://stackoverflow.com/questions/458757/wildcard-subdomains-in-iis7-is-it-possi可以让他们像在阿帕奇一样...... [ ^ ]
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[^]


这篇关于Asp.net:为每个城市创建一个子域名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆