These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for ERR_TOO_MANY_REDIRECTS with Apache on the new forum.
Hello everyone.
I have a clean installation of Virtualmin and I have created a new virtual server with SSL enabled. I have created the following permanent redirect so that the http traffic on port 80 is redirected to https:
later when I navigate to http://domain.com I get the typical ERR_TOO_MANY_REDIRECTS
i am using apache
You're redirecting from /(root) to https://(root) which is a circle, root to root. It might work by going from / to https://domain.com/index.php
But I've done it like this. /index.php to https://domain.com/index.php. If your index file is not php, then put index.html or what ever it happens to be.
Thanks for your response, I really don't want to go to index.php, I want to redirect any traffic from http to https, whatever the url.
Thanks again, I understood the problem thanks to you but I don't know how to fix it
Even so I only have the redirection on port 80, not on 443, it is assumed that a request is first made to port 80, which has a redirection to https on port 443 and as on the server that listens on port 443 I don't have any redirection I should stay there and not redirect
I have placed the following in .htaccess:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://domain.com/$1 [R,L]
I keep getting the same error. I can't understand how applying the condition of port 80 continues to get that error.
The .htaccess file works runs well so that is not the problem
I have finally managed to solve the problem. It was not a virtualmin problem if not my DNS (Cloudflare and my router).
Port 443 was not open due to a problem in the router (it seems that it has that little bug) and cloudflare detected that and redirected traffic 443 to 80, and my server 80 to 443 thus entering a loop