How to prevent redirects from http to https on localhost in chrome and firefox?
Asked Answered
C

2

9

Why can't I access any of my local development sites anymore? Firefox and Chrome both redirects to HTTPS (localhost/site becomes https://localhost/site and throws an error) ...

I'm not going to set up SSL on my localhost development machine ... How would I prevent ALL browsers from redirecting to HTTPS?

Cockboat answered 9/6, 2021 at 11:29 Comment(2)
As far as I remember some web browsers have changed their default behavior to use https by default if you don't specify the protocol. So you have to enter http://localhost/site in address bar.Tenement
Yes, but that doesn't do the job ... it still forces the redirect even when specifying the protocol. Reinstalled both browsers ... fixed the issue. Now, it MAY have been some sort of caching issues ... but wasn't able to just clear the cache ... therefore the reinstall.Cockboat
E
2

Enter below command depending on browser : chrome://net-internals/#hsts edge://net-internals/#hsts

under Delete domain security policies put "localhost" and delete.

Excurved answered 28/6 at 7:37 Comment(0)
A
-3

Auto redirect http to https is normally caused by installation of a new plugin or certificate. Check out this question for how to solve it.

Alliance answered 9/6, 2021 at 11:36 Comment(2)
"this question" is nine years old. This is nothing to do with plugins, at least in 2022. Some comments to "this question" are quite new though and may help some people.Gruchot
@Gruchot This is an great answer and also the linked question. Certain plugins (a.k.a. extensions) and installing localhost certificates can indeed trigger the browsers (Chrome in my case) to add localhost to the HTST list. "this question" which you dismissed (and others voted down) has a perfectly good solutions to the problem. And it still applies in 2023.Paprika

© 2022 - 2024 — McMap. All rights reserved.