ASP.NET MVC 和 ApplicationPath
问题是关于路径和域:
我有一个开箱即用的 ASP.NET MVC 项目(由“文件 -> 新项目”生成)。
在登录页面上,它执行以下操作:return Redirect("~/Account/LogOn");
。
我有一个域名:mycompany.com
,以及服务器上的以下文件结构:
/Root
/MyApp (this is where my app goes into)
Default.aspx
...
我已经设置了以下域指针:mycompany.com -> \MyApp
当我访问 mycompany.com
时,出现错误,找不到相关信息mycompany.com/MyApp/MyApp/Account/LogOn
问题:第二个 /MyApp
路径元素来自哪里?
注意:如果我不使用域指针并将站点部署到根目录 - 一切都会正常工作。
注意:我的托管提供商是 webhost4life.com
。
Question is about paths and domains:
I have an out-of-the box ASP.NET MVC project (generated by "File->New Project").
On LogOn page it does: return Redirect("~/Account/LogOn");
.
I have a domain name: mycompany.com
, and following file structure on the server:
/Root
/MyApp (this is where my app goes into)
Default.aspx
...
I have set up following domain pointer: mycompany.com -> \MyApp
When I go to mycompany.com
I get an error, something about can't findmycompany.com/MyApp/MyApp/Account/LogOn
Question: Where does second /MyApp
path element comes from?
Note: If I don't use domain pointer and deploy the site to the root - everything works just fine.
Note: My hosting provider is webhost4life.com
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请尝试“return Redirect("/Account/LogOn")”。
Try "return Redirect("/Account/LogOn")" instead.