是否有可能重写子文件夹的IIS7子域? [英] Is it possible to rewrite subfolder to subdomain with IIS7?
问题描述
我有子域sub.domain.com一个asp.net应用程序,我想通过键入www.domain.com/sub访问此应用程序可以用IIS7?
I have an asp.net application on sub domain sub.domain.com I want to access this application by typing www.domain.com/sub is it possible with IIS7?
推荐答案
假设你很高兴手动配置在每个子应用:
Assuming you're happy to manually configure the application at each subdomain:
- 在IIS管理器,进入网站,并选择您www.domain.com网站。
- 右键单击它,同一个位置添加应用程序,并指定别名亚健康,并指出物理路径sub.domain.com
- 选择相同的应用程序池作为sub.domain.com网站。
另外,您可以通过在www.domain.com网站创建一个新的虚拟目录,然后滴加在做一个HTTP重定向一个default.html中的文件设置重定向。
Alternatively you could set up a redirect by creating a new Virtual Directory in your www.domain.com site, then dropping in a default.html file that does a http redirect.
一个posher(多对用户透明)重定向可以像这样进行:
A posher (and more transparent to the user) redirect could be done like so:
- 打开提升的命令提示符
-
运行以下命令:
- Open an elevated command prompt
run the following command:
%WINDIR%\\ SYSTEM32 \\ INETSRV \\ appcmd设置配置nameofsite / virtualdirectoryname-section:system.webServer / HTT predirect - 启用:真-destination:destinationofredirect -commitpath:APPHOST
%windir%\system32\inetsrv\appcmd set config "nameofsite/virtualdirectoryname" -section:system.webServer/httpRedirect -enabled:true -destination:destinationofredirect -commitpath:apphost
我举起从:<一href=\"http://www.andrewwestgarth.co.uk/Blog/post/2008/07/31/Creating-Http-Redirects-in-IIS7-on-Virtual-Directories-like-IIS6.aspx\" rel=\"nofollow\">http://www.andrewwestgarth.co.uk/Blog/post/2008/07/31/Creating-Http-Redirects-in-IIS7-on-Virtual-Directories-like-IIS6.aspx
这篇关于是否有可能重写子文件夹的IIS7子域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!