Errors displaying a hosted website in IIS on a local server with localhost\website

Raoul Hunziker 1 Reputation point
2021-11-15T11:41:46.537+00:00

Hi

On a server 2012R2 with IIS 8.5 running, I have a website that works fine on the internet eg https://www.website.co.za/fax/index.asp.

When I try to display the website on the machine where it is hosted, I cannot get it to display eg

http://localhost/fax/index.asp. or http://127.0.0.1/fax/index.asp.

The entered http://localhost/fax/index.asp. changes to https://www.website.co.za/fax/index.asp.

I get an Error 404.

I have looked at the bindings and port 443 does point to www.website.co.za with a certificate. I am assuming that this can be resolved in the bindings but cannot get this resolved here no matter what I have tried

Any ideas how to resolve this as I need to see if this upgraded server has not broken the IIS before we go live.

Internet Information Services
{count} votes

1 answer

Sort by: Most helpful
  1. Raoul Hunziker 1 Reputation point
    2021-11-17T10:59:54.44+00:00

    Hi Bruce

    Thanks for the response.

    I found that the previous IT guy added the incorrect designation in the host file to the 127.0.0.1 address and hence it always failed on the server. So that resolved the display to localhost on the live server. So it's not an IIS error on the live box.

    Host file info that work is as follows:
    127.0.0.1 www.website.co.za/fax
    This did not work
    127.0.0.1 www.website.co.za

    On the test box, I still cannot get it to display the localhost using the test box IIS. So I don't know if the IIS on the test box broke during the upgrade.
    So here is some of the information you asked for on the bindings as the test box also goes to the live server before I added the additional bindings below.

    Current bindings
    https www.website.co.za IP of live server Port 443 and a certificate
    http www.website.co.za IP : All Unassigned Port 80

    I added the following binding
    http www.website.co.za IP : local machine (192.168.1.12) Port 10082
    Opened the firewall incoming ports to 10082

    Then tried to force a connection to the test machines IIS by entering from another machine on the local network
    http://192.168.1.12:10082/www.website.co.za/fax
    http://192.168.1.12:10082/www.website.co.za
    http://192.168.1.12:10082/website

    Result on all was:
    Bad Request - Invalid Hostname
    HTTP Error 400. The request hostname is invalid.

    Same result when I entered the above options with http://localhost:10082 on the test box as opposed to the actual 192.168.1.12.

    Any ideas on how to get the test box IIS to display the website?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.