Lars Holdgaard
Lars Holdgaard

Reputation: 9966

ASP.NET URL Routing gives 404 pages

I have setup url routing in my ASP.NET 4 project, which works perfectly offline. However, now when it is online - every link which has been setup by url routing doesn't work.

Basically a link like this: http://www.domain.com/test/bla

Will always return a 404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Oh well, I decided to try to fix it. I found the following tips which did not work (and can't seem to find any other):

1. Have the following code in the web.config:

<modules runAllManagedModulesForAllRequests="true">

2. Following this article: http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html. No succes.

3. Changing my servers pipeline mode to integrated.

Still, 404 errors.

Any ideas?

Upvotes: 1

Views: 2961

Answers (1)

Rich O&#39;Kelly
Rich O&#39;Kelly

Reputation: 41757

Ensure that the "verify file exists" setting in IIS is not checked (I believe it is by default), where this setting lives depends on whether you're hosted by IIS6 (or less) or IIS7 (or higher).

IIS7 - http://blogs.iis.net/bills/archive/2007/05/25/tip-trick-how-to-turn-off-quot-verify-file-exists-quot-in-iis7.aspx

IIS6 - IIS Manager -> Web Site Properties -> Configuration -> Mappings -> Verify file exists checkbox

Upvotes: 1

Related Questions