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? :)
127 Answers
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.
4I 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:
- Open the IIS Manager. You can type it in the Windows search bar.
- In the file tree in the 'Connections' box, select the root of web application.
- In the Features View that appears in the middle of the screen, select
Request Filtering. - In the
File Name Extensionstab, ensure that.htmldoes not have the valuefalse. - In the
Hidden Segmentstab, 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.
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.
2Check the following:
- Find the Authentication Configuration (Anonymous, Basic, Windows, ...)
- Based on the Authentication configuration, check that the account accessing the file (Anonymous, IUSR, SYSTEM, Authenticated Users, ...) has enough NTFS permissions
- Check if the file extension is not filtered in Request Filtering
- Check if the file extension is explicitly declared in MIME types
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.
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.
I was having the same problem and more. Not only would the html pages not show, but also the images. I noticed the MIME types was not listed in my new computer under the IIS settings and went in and added all the services I could find under Windows Features for IIS. I know its the shotgun approach, and one of those is responsible for the MIME but everything started working correctly once I did this.