RenegadeAndy
RenegadeAndy

Reputation: 5690

IIS HTTP 404 when trying to view my site

I have deployed a website which is a C# .net ASP project to IIS.

It appears to be running and the URL I believe to access my login page I think would be :

http://andyworker.hopto.org:8080/login/default.aspx

However if you visit that URL you will spot the HTTP 404 I reference!

Please see the sites configuration in the IIS Manager in the below screenshot.

HTTP 404 problem

Am I doing something wrong - is my URL wrong?

Upvotes: 0

Views: 1769

Answers (1)

gunr2171
gunr2171

Reputation: 17447

Usually when you get a 404 error when you know you shouldn't, it's because IIS doesn't know how to run the file.

Take for example an MVC project, you could have a url like \\server\MyMvcApp\Admin\Users. There is no file or folder for Admin\Users, you would only know about that if you ran the code. So if IIS doesn't know how to run your code, and it can't find a file that matches, it gives up and throws a 404.

That's why I said "look at your application pool" settings first. That is the first thing IIS uses to run your code. If those settings are wrong then everything else is useless.

It seemed that you had .Net 2 either set as your default or incorrectly set in your application pool. Because of this, IIS doesn't know how to run your application, and gives up.

I'm surprised you didn't get some framework-related error, maybe if you viewed it from localhost you would have seen it.

So bottom line, make sure you tell IIS how to run your code. The correct .Net framework is always a good start.

Upvotes: 1

Related Questions