Fix Google Chrome Redirecting Localhost to HTTPS (SSL)

Posted on in: All Posts, How To's.

Hopefully one of the following solutions will help. I ended up having to change my .dev domains to .local so solve the issue.

Hard Refresh

First try a hard refresh.

  • In chrome this is usually Ctrl+Shift+R for Windows & Linux, or Command+Shift+R for Mac.

Clear Browsing Data

Clearing your browsing data is always a good second step when trying to fix redirection issues in your browser. This usually clears cached DNS queries which can cause this sort of issue.

  • In the Chrome address bar type “chrome://settings/clearBrowserData
  • Check “Cached images and files
  • Click the “Clear Data” button

Delete Domain Security Policies

This is not a permanent solution. If one of your localhost domains uses HSTS and you browse to it, your other domains will stop working again.

  • In the Chrome address bar type “chrome://net-internals/#hsts
  • At the very bottom of a page is QUERY domain textbox – verify that localhost is known to the browser. If it says “Not found” then this is not the answer you are looking for.
  • If it is, DELETE the localhost domain using the textbox above
  • Your site should now work using plain old HTTP

Change .dev or .foo to .local (or something)

In later versions of chrome including Chrome Canaray, all .dev and .foo domains are forced to used HSTS. Change .dev or .foo to something else to avoid this. I use .local now.

  • On Windows edit 
  • On Linux edit /etc/hosts
  • On Mac OSX edit /private/etc/hosts