Dewey
Dewey

Reputation: 892

"This webpage is not available" from localhost after SSL removed

When I attempt to debug my ASP.NET MVC 5 project I am getting the IIS error "This webpage is not available". Here is the sequence of events that led to this:

I'm not sure what to do next because my project is unusable right now. Any help appreciated.

Upvotes: 2

Views: 2901

Answers (3)

mrsen
mrsen

Reputation: 127

If it happens with other projects as well then try to disable windows firewall or any other firewalls on the system and hopefully it should work.

Also try to run the website without fiddler and see if it works.

I had similar problem and it was the firewall causing it.

Upvotes: 1

Robert Calhoun
Robert Calhoun

Reputation: 5133

With HTTPS, you can only have one "web site" per ip_address:port. So https://localhost, https://example.com, it's all the same (modulo certificate errors.)

HTTP, however, allows multiple web sites per ip_address:port pair, via the "HOST" header in the HTTP 1.1 spec. IIS needs to know what site you want, and it defaults to binding the web site to the machine's hostname. (That is probably what is getting you.)

If you just want all requests that resolve to your host (like "localhost") to hit the same web site, edit the site bindings in inetmgr and set "Host Name" to empty string or *.

Upvotes: 0

Montri M
Montri M

Reputation: 1766

Did you happen to had an entry in web.config that force a redirection to the HTTPS site?

<rewrite>
  <rules>
    <rule name="Redirect to HTTPS" stopProcessing="true">
      <match url="^account/logon$|^account/register$" />
      <conditions>
        <add input="{HTTPS}" pattern="^OFF$" />
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:0}" redirectType="Permanent" />
    </rule>
  </rules>
</rewrite>

Note that redirectType="Permanent", it will return Permanent Redirect(301) to your browser. This will be cached permanently on your browser so you couldn't access the normal HTTP site even if you've removed this redirection. You will need to manually clear your browser caches to fix it.

Upvotes: 2

Related Questions