Page not found in IIS, but it's there

8

I have just installed IIS on Windows Server 2008. If I go to localhost, the default page is displayed, so the web server is ok.

I have added a folder with a page in it in the \inetpub\wwwroot directory. The full path to the page is then C:\inetpub\wwwroot\folder\file.html.

I have restarted the services but if I navigate to localhost/folder/file.html I get a 404 file not found error.

Obviously I have forgotten something simple, but what is it? :)

user1301428

Posted 2014-04-14T10:44:54.637

Reputation: 2 985

I am having the same issue, can't get it working. I created a Windows account IUSER_IIS, gave him full permissions on the app directory, set app identity to that user, and created an app pool with that identity, set app to use the app pool. It can read a simple .HTML file, but I get HTTP 404 on Default.aspx. Any ideas? Further details you need? – Jay Imerman – 2019-02-25T17:00:11.347

If your using Visual Studio's publishing, make sure you've actually published it or it'll give a 404. – facepalm42 – 2019-12-17T06:14:59.400

Check error log, you will find what exactly it is searching – J Bourne – 2014-04-14T11:56:48.927

@Sai It is searching that exact file: GET /folder/file.html - 80 – user1301428 – 2014-04-14T12:08:29.050

I think this is from access log, there will be error log, whenever it fails...! – J Bourne – 2014-04-14T12:10:58.780

@Sai Uhm, weird.. That's the only log file I have.. – user1301428 – 2014-04-14T12:25:16.200

Check this, http://forums.iis.net/t/1189242.aspx?IIS+7+HTTP+Error+Log+Location

– J Bourne – 2014-04-14T12:28:18.347

what are the permissions on C:\inetpub\wwwroot\folder\ ? – Frank Thomas – 2014-04-14T12:30:14.910

@FrankThomas For the purposes of this test, Allow to all and for all users. – user1301428 – 2014-04-14T12:34:02.900

most of the time, anonymous accounts are not part of the "everyone" group, so make sure you have IUser or Anonymous permitted to read the files. – Frank Thomas – 2014-04-14T13:53:47.803

I would recommend playing with user permissions if I remember correctly I had an issue with IUser or IIS_user that not being set properly and received the same message. – Brian – 2014-04-14T13:22:45.077

@FrankThomas Anonymous logon is also in the users who are allowed to read the files in the folder :( – user1301428 – 2014-04-14T14:31:12.943

Answers

8

For anyone that run into this and don't find the other suggestions effective, also check that Windows is displaying file name extensions. Open Windows Explorer, click "View" in the top bar and then check "File name extensions".

I found that my file was actually named index.html.txt even though it was displaying index.html prior to checking the above setting.

Martin Carstens

Posted 2014-04-14T10:44:54.637

Reputation: 191

3Thank you. I change this setting on every computer I used but didn't think about it when setting up a server. That fixed it – Dan Roberts – 2017-12-07T21:55:53.407

3OMFG I just spent an HOUR looking in increasingly detailed IIS log files on a new IIS deployment, and it was this. – Whelkaholism – 2018-05-23T14:42:44.390

5

I had this same problem.

Observe your path: C:\inetpub\wwwroot\folder\file.html.

Ensure that:

  • The file name extension you are requesting (in this case, .html) is not being blocked by IIS.
  • The directories along the path you are requesting (in this case, folder) are not being blocked by IIS.

If you are on Windows 8/ Windows 10, you can check those two things in the IIS Manager desktop application.

Here is how:

  1. Open the IIS Manager. You can type it in the Windows search bar.
  2. In the file tree in the 'Connections' box, select the root of web application.
  3. In the Features View that appears in the middle of the screen, select Request Filtering.
  4. In the File Name Extensions tab, ensure that .html does not have the value false.
  5. In the Hidden Segments tab, ensure that NONE of the folders in your path (C:\inetpub\wwwroot\folder\file.html) are listed.

NOTE: If you cannot see the Request Filtering tool, you may not have enabled all of the IIS features. Search for 'Turn off windows features' on your machine. In the Windows Features manager, select all of the boxes in Internet Information Services -> World Wide Web Services and select the box Internet Information Services -> Web Management Tools -> IIS Management Consoles.

scottyseus

Posted 2014-04-14T10:44:54.637

Reputation: 151

0

I had this same error. My issue was that I accidentally installed another instance of DNN to the same SQL database. I restored a backup of my database to a new database then pointed the config file to the new database. Then both instances worked great.

Nathan Heinrich

Posted 2014-04-14T10:44:54.637

Reputation: 1

0

In the IIS Connections pane, click on the Sites node and check the Status column on the right. In my case, the Default Web Site was stopped and was giving me 404 error.

Matstar

Posted 2014-04-14T10:44:54.637

Reputation: 1

0

I've had this issue before - I had to set the username and password in again at Anonymous Authentication and it worked perfectly. You can also switch on Detailed errors at Error Pages in IIS to give more info.

Lisa

Posted 2014-04-14T10:44:54.637

Reputation: 57

What did you reset the username and password to? – user1301428 – 2014-04-14T14:49:30.593

It was a domain account which was part of Admin and IIS users. All I did was put the details in again. – Lisa – 2014-04-16T06:44:46.650