ASP.NET MVC 子域显示文件夹名称
我正在使用 godaddy 共享托管,采用 IIS7、集成模式,并将沼泽标准 MVC2 应用程序发布到使用 Visual Web Developer 2010 创建的 dev.lazygekko.com。
这一切都有效,但是当单击任何链接时,它们会指向到 dev.lazygekko.com/dev/...,dev 是它指向的文件夹。
谁能告诉我我可能做错了什么?
非常感谢。
更新
我现在已经设法完全打破它与设置的混乱,但是当我让它再次工作时的任何想法将非常感激...
更新2
现在在mvc.lazygekko.com上备份并运行。如您所见,网址有 mvc.lazygekko.com/mvc/... 但我只想要 mvc.lazygekko.com。
谢谢
更新3
链接是直接开箱即用的:
<%= Html.ActionLink("Home","Index","Home") %>
虽然我确实将项目更改为.net 3.5而不是4.0,但将:更改为=。
I'm using godaddy shared hosting, with IIS7, Integrated mode, and published up a bog standard MVC2 app to dev.lazygekko.com created with Visual Web Developer 2010.
It all works, however when any of the links are clicked, they point to dev.lazygekko.com/dev/..., dev being the folder it is pointing at.
Can anyone shed some light on what I may be doing wrong?
Many thanks.
UPDATE
I've now managed to break it completely messing with settings, but any ideas for when I get it working again would be most appreciated...
UPDATE 2
Now back up and running on mvc.lazygekko.com. As you can see, urls have mvc.lazygekko.com/mvc/... But I just want the mvc.lazygekko.com.
Thanks
UPDATE 3
The links are straight out of the box:
<%= Html.ActionLink("Home","Index","Home") %>
Although I did change the project to .net 3.5 instead of 4.0, changing the : to a =.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尽管 Godaddy 没有任何用处,但解决问题的方法显然就在他们的社区部分。
这是解决方案的网址:
http://codebeater.com/2010/05/solution-for-asp-net-mvc-routing-issue-on-godaddy-shared-hosting/
这就是你必须做的(适用于已安装 url 重写模块的 IIS7):
添加
到 web.config 中的 system.Webserver。
但是,这让我很困惑,请确保双引号是正确的双引号,否则 IIS 将爆炸。
Despite Godaddy being of no use whatsoever, the solution to the problem was apparently sitting under their noses in their community section.
This is the url of the solution:
http://codebeater.com/2010/05/solution-for-asp-net-mvc-routing-issue-on-godaddy-shared-hosting/
And this is what you have to do (works on IIS7 with the url rewriting module installed):
Add
to system.Webserver in web.config.
But, and this tripped me up, make sure the double quotes are correct double quotes otherwise IIS will explode.