SSL ERR TOO MANY REDIRECTS

Reported by: Dimitri Nain
Created: 6 months 24 days ago
Last reply: 4 months 17 days ago
Views: 54

Hey guys, 

i installed tinycp today and everything runs fine so far. but i have one big problem, i cant use ssl for my site. i created a letsencrypt certificate and activate "Redirect from HTTP to HTTPS (permanent 301)". Now i cant open my site and get this error instead: 

This page isn’t working

mydomain redirected you too many times.

ERR_TOO_MANY_REDIRECTS

I had the same issue and I solved it by editing the apache.conf file of the domain name. The file is located at /opt/tinycp/domains/domainname.com

Before changes:

	<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !/\.well-known/acme-challenge/ [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>

After the changes:

	<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
    RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteCond %{REQUEST_URI} !/\.well-known/acme-challenge/ [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>

Hope it helps.

Join our Discord server
Write a reply Edit a reply