我從3天開始遍歷Stackoverflow和谷歌。我沒有得到任何確切的步驟,如何完成它...我閱讀了所有這些問題在stackoverflow,許多人問這個問題,並沒有得到確切的步驟來做這個任務。在iis7 asp.net上註冊時創建一個帳戶的子域
subdomain rewriting in ASP.NET?
https://serverfault.com/questions/58050/generating-content-based-on-subdomain
Creating subdomains on the fly
How to add a subdomain to an asp.net website?
How to allow users to create their own subdomains on my MVC website?
web.config rule for sub-directory to sub-domain redirection
Use Web.Config to redirect a directory to a subdomain
URL Rewrite for subdomains in ASP.Net
現在這就是我要做的:當用戶註冊在我的網站,那個時候創建這樣
<用戶名用戶名的子域> .domain.com like abc.domain.com,xyz.domain.com
它必須指向d omain.com/Users/ <用戶名> /index.asp
這是一個很好的例子http://ytmnd.com/
我使用Windows與IIS7託管和我使用asp.net。
我在DNS中設置通配符條目,當用戶點擊< anyname> .domain.com時,它指向默認的Plesk服務器網頁;
我天璣有它假設這樣的工作任何線索或將其應指向我的主要domain.com
請給我提供的步驟爲什麼不能使用來完成這個任務 感謝
謝謝你的回覆,我試了一下,但在第二步後卡住了。它說:「那麼你在IIS中設置一個URL重寫規則,將URL變成形式.......」因爲我使用託管公司的共享主機,所以我沒有直接訪問IIS的權限。那麼如何實現這一步? –
戴維斯,我得到了一些改進,現在當我輸入 .mydomain.com然後它將它指向mydomain.com。現在沒有下一個線索該怎麼做,所以它將直接指向用戶文件夾,例如。 user1.mydomain.com to mydomain.com/users/user1/index.aspx –
發佈您正在使用的代碼以使其現在重定向。 – davids