tags:

views:

441

answers:

2

i have an asp.net mvc website. http:/mywebsite.com (just for this example)

I have been testing this asp.net mvc website locally on my machine and everything works fine on my local machine during testing. When i deploy to my web server

when i bring up http://mywebsite.com it goes to HomeController and load the view Views/Home/Index.aspx (which is perfect). So the main default page is fine.

The issue is, if i click any other other links (again that all seem to work fine locally) i get the following error:

The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Please try the following:
* Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
* If you reached this page by clicking a link, contact the Web site administrator to alert them that the link is incorrectly formatted.
* Click the Back button to try another link.
HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)

some examples would be:

http:/mywebsite.com\Photos
http:/mywebsite.com\Links

there definitely are controllers and views setup for this (or it wouldn't work locally).

does anyone have any idea how this might work fine locally but somehow on the webserver it doesn't

+4  A: 

Are you running the site on II7 in integrated mode? If not, you need to add a wildcard handler so that all URLs get mapped to your application. See Phil Haack's blog post on running ASP.NET MVC ON IIS 6.

Lance Fisher
If it wasn't obvious from this answer, you will also have to do this if you are deploying with iis 6.
Mallioch
Just edited my answer to make that clear :)
Lance Fisher
i am running iis 6
ooo
Definately, check out that blog post, it'll walk you through the steps to make it work.
Lance Fisher
i am trying to get extension less URLs so i am first going to look at the wildcard comments
ooo
fixing wildcard did the trick !!!
ooo
Great! Glad to hear it.
Lance Fisher
A: 

Something else to watch out for. I had a static website - deployed on IIS 7.5. Added some MVC Controllers to handle some simple server side apps and then re-deployed it. I didn't copy the web.config file, because I wrongly assumed that everything that was needed was in the one that was automatically created by the server.

You must copy the web.config up as well.

Peter Munnings