Localhost not found (404) iis

17,017

Solution 1

Make sure that IIS is actually configured to listen on 127.0.0.1 (perhaps you removed the binding previously?)

netsh http show iplisten
IP addresses present in the IP listen list: 127.0.0.1

You can add additional IPs like so:

netsh http add iplisten ipaddress=10.0.0.10

Solution 2

I just had this problem too and it turned out to be an issue with Default Web Site's bindings in IIS. I had specified the "Host Name" to be the server's domain name, meaning external access worked fine but trying to access any IIS page through localhost returned a browser 404 error.

Simply clearing that "Host Name" field and leaving it blank fixed the problem for me.

Solution 3

I added a binding to the site that accepted IP address 127.0.0.1 over port 80 and was able to connect.

Share:
17,017
Bryan Arbelo - MaG3Stican
Author by

Bryan Arbelo - MaG3Stican

I usually do meetups for fun, trying to encourage the developer community to feel stronger and try new things! One of my presentations : https://www.meetup.com/es-ES/Melbourne-F-enders/events/241994239/

Updated on June 04, 2022

Comments

  • Bryan Arbelo - MaG3Stican
    Bryan Arbelo - MaG3Stican almost 2 years

    I am having several issues with the DNS localhost on my computer.

    Some instruction is redirecting all my explorers, including visual studio somewhere else than 127.0.0.1 when I visual studio or any browser looks for localhost.

    Where can such thing be happening? I recently changed my hosts file to point localhost somewhere else, but then it did not work so I switched it back, so that cant be the problem.

    # Copyright (c) 1993-2009 Microsoft Corp.
    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    #
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a '#' symbol.
    #
    # For example:
    #
    #      102.54.94.97     rhino.acme.com          # source server
    #       38.25.63.10     x.acme.com              # x client host
    
    # localhost name resolution is handled within DNS itself.
    127.0.0.1 localhost
    ::1 localhost
    

    I have also unistalled and installed IIS, so is not a problem of iis not redirecting properly..

    I am not being able to run Visual Studio solutions because of this problem.

    I have tried pining 127.0.0.1 and it responds, I have also tried localhost and it also works, but when I type localhost on a browser it redirects to a "404" page.

  • Ryan
    Ryan about 3 years
    This helped me. I had bindings for my web URLs but did not have one for localhost. Adding a localhost binding worked.