ERR_TOO_MANY_REDIRECTS - ssl certbot / cms wordpress / standart .htaccess

August 12, 2019 211 views
Let's Encrypt CentOS WordPress Apache

Hello anyone can help me solve my issue about ERRTOOMANY_REDIRECTS

OS: centos 7 64bit
Php version: 7.2

thanks

My VirtualHost conf

<VirtualHost *:80>
    ServerName www.gloryragnarok.com
    ServerAlias gloryragnarok.com
    DocumentRoot /var/www/gloryragnarok.com/html
    ErrorLog /var/www/gloryragnarok.com/log/error.log
    CustomLog /var/www/gloryragnarok.com/log/requests.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =gloryragnarok.com [OR]
RewriteCond %{SERVER_NAME} =www.gloryragnarok.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

and

<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName www.gloryragnarok.com
    ServerAlias gloryragnarok.com
    DocumentRoot /var/www/gloryragnarok.com/html
    ErrorLog /var/www/gloryragnarok.com/log/error.log
    CustomLog /var/www/gloryragnarok.com/log/requests.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/gloryragnarok.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/gloryragnarok.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/gloryragnarok.com/chain.pem
</VirtualHost>
</IfModule>

my .htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

i also use cloudflare but on development mode

thanks ^^

1 Answer

Hello,

I believe that your Wordpress site and home URLs are currently set to http://yourdomain.com rather than https://yourdomain.com. That’s why when you add the https redirect you get a redirect loop.

You can change your Site and Home URLs via your Wordpress admin area -> Go to Settings -> General screen in a single site installation of WordPress, there are two fields named “WordPress Address (URL)” and “Site Address (URL)”.

As always, make sure to create a backup before making any changes.

Hope that this helps.
Regards,
Bobby

Have another answer? Share your knowledge.