在子目录中创建 ASP.Net 应用程序还是 URL 重写?
我有一个 ASP.Net 4.0 Web 应用程序运行在:
www.foo.com
客户要求将应用程序移至:
www.foo.com/bar
现在我无法访问 DNS 记录来设置子域。我应该通过 URL 重写来完成此操作还是应该使用虚拟目录?如何将子目录 bar 设置为应用程序根目录?
这里的最佳实践是什么?
更新 我已经创建了一个虚拟目录,但在浏览它时出现此错误
解析器错误消息:在应用程序级别之外使用注册为allowDefinition='MachineToApplication'的节是错误的。此错误可能是由于未将虚拟目录配置为 IIS 中的应用程序而导致的。
更新请参阅我的回答如下
I have an ASP.Net 4.0 web application running on:
www.foo.com
The client has asked that the application be moved to:
www.foo.com/bar
Right now I do not have access to the DNS Records to setup a sub domain. Should I do this with URL Rewriting or should I use a Virtual Directory? How do I set the subdirectory bar as the application root?
What are the best practices here?
UPDATE I have created a virtual directory but get this error when I browse to it
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
UPDATE See my answer below
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一个小时左右的有趣的互联网搜索后,我是如何让它工作的:
Well after a fun hour or so scouring the interwebs here's how I got it to work: