Getting to error => This page isn’t working www.domain.com redirected you too many times. ERR_TOO_MANY_REDIRECTS

October 21, 2019 365 views
Apache

I added SSL using certbort from tutorial provided by digital ocean and redirect http to https but after this my site giving me error before this site was working fine with http://
My code of .conf is

<VirtualHost *:80>
ServerAdmin xxxx@xxxx.com
DocumentRoot /var/www/domain/
ServerName domain.com
ServerAlias www.domain.com
ErrorLog ${APACHELOGDIR}/error.log
CustomLog ${APACHELOGDIR}/access.log combined

RewriteEngine on
RewriteCond %{SERVERNAME} =domain.com [OR]
RewriteCond %{SERVER
NAME} =www.domain.com
RewriteRule ^ https://%{SERVERNAME}%{REQUESTURI} [END,NE,R=permanent]

</VirtualHost>

Please help with the solution

1 Answer

Hello, @enayat

You basically have a redirect rule that keeps running and therefore generating too many/infinite redirections.

Are you using a CMS like WordPress? Also do you use .htaccess files and if so can you paste the content of the file for the domain name in question as well?

Have another answer? Share your knowledge.