ASP.Net MVC路由在本地工作,但不能在远程工作 [英] ASP.Net MVC routes work locally but not remotely
问题描述
我知道这个问题以前已经解决过,但是我没有找到解决方案.我已经创建了一个MVC网站.当我在本地运行它时,一切正常,但将其上传到我们的网络时,路由不起作用,并且出现404错误.
I know this issue has been addressed before but I have not found an answer to my situation. I have created a MVC website. When I run it locally everything works but upload it to our web sever the routes don't work and I get a 404 error.
这是我的本地链接 http://localhost:49641/
这是网址 www.hovdenoil.com
Here is the web address www.hovdenoil.com
让我知道您是否需要我的任何代码.
Let me know if you need any of my code.
推荐答案
从您的网站发送的标头中可以看出,您正在运行IIS6.要使路由在IIS6上起作用,还需要执行其他步骤.您可以在这里阅读有关它们的信息:
Looks like from the headers your site is sending you are running IIS6. There are additional steps required to make routing work on IIS6. You can read about them here:
http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
http://haacked.com/archive/2010/12/22/asp-net-mvc-3-extensionless-urls-on-iis-6.aspx
或者,如果您有选择的话,我强烈建议您升级到IIS7 +,这对MVC的路由要好得多.
Alternatively, if you have the option, I would highly recommend upgrading to IIS7+, which works much better with MVC's routing.
这篇关于ASP.Net MVC路由在本地工作,但不能在远程工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!