ERR_TOO_MANY_REDIRECTS after setting up SSL

April 19, 2019 744 views
Apache Let's Encrypt Security

So I followed this guide https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04 to secure apache so I could have https enabled. When I got to the step that asked “Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.” I chose option number 2 to redirect traffic to https. Now I get an error when trying to access my site “www.unleashedmc.net redirected you too many times.”.

This is the output I get when running “sudo apache2ctl -S”
https://paste.ee/p/3vlUs

This is my apache2.conf https://paste.ee/p/JHMBE

This is my unleashedmc.net.conf https://paste.ee/p/CKJAV

This is my unleashedmc.net-le-ssl.conf https://paste.ee/p/N7G8J

Any help would be greatly appreciated.

1 Answer
jarland MOD April 19, 2019
Accepted Answer

Greetings!

It looks like https://www.unleashedmc.net is loading without a redirect. Were you able to solve the issue?

In any case, when this happens there can be a few causes, but one stands out as the most common. Some of the most common web applications, like Wordpress (common enough to be worthy of mention for future readers that land here), will store the site URL in their configuration. Often they will redirect to that site URL. By setting the site URL as the http site and setting the web server to redirect to https, this can trigger a loop in which the web server redirects to https and the application redirects to http. Though this may not be your situation, anyone reading in the future that experiences this and happens to use Wordpress can find information about changing the site URL here:

https://codex.wordpress.org/Changing_The_Site_URL

In your specific case I do not see a CMS at all, nor do I see a redirect loop in your configuration. I suspect it may have been a cached redirect with a web browser. I’ve seen Chrome do that one too many times.

Jarland

Have another answer? Share your knowledge.