Solved: WordPress admin not working on .dev domains – ERR_TOO_MANY_REDIRECTS

So, you just got your new .dev domain and can't access the WordPress admin dashboard? Here is how to solve this issue.

We couldn’t be more excited after the release of this new gTLD operated by Google. The new .dev domains are specially useful for us developers as a tool to aggregate value to our resumes and to help each other by  sharing information on the internet. But if you just got your new domain and setup a new WordPress on your hosting, you may be experiencing the following error when you try to access your /wp-admin for the first time:

Error: This webpage has a redirect loop, ERR_TOO_MANY_REDIRECTS or This page isn't working / redirected you too many times

Error: This webpage has a redirect loop, ERR_TOO_MANY_REDIRECTS or This page isn’t working / redirected you too many times

This error happens because every .dev domain is on the HSTS preload list. HTTP Strict Transport Security (HSTS) list is a list of sites that are hardcoded into Chrome as being HTTPS only. This list is also used by most major browsers such as Firefox, Opera, Safari, IE 11 and Edge, and makes HTTPS required on all connections for the websites present on it. If your WordPress is hosted behind a reverse proxy that provides SSL, but is hosted itself without SSL, these options will send all requests into an infinite redirect loop. You can fix that issue by adding the following code to the beginning of your wp-config.php  file:

Clear your browser’s cache and try to access your /wp-admin again. Everything should be working fine.