Err_too_many_redirecs when I configure https redirection

Keywords: WordPress - AWS - Technical issue - Secure Connections (SSL/HTTPS)
bnsupport ID: d6d8a33a-bbc6-4f68-7718-380f9504c17a
Description:
I am following the steps described in the following guide

https://docs.bitnami.com/bch/apps/wordpress/administration/force-https-apache/

but I get the following error ERR_TOO_MANY_REDIRECTS

d6d8a33a-bbc6-4f68-7718-380f9504c17a

Hello @jselva,

Note you need to follow approach B. Change this line:

  RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L

With the current domain you want to use. For example:

 RewriteRule ^/(.*) https://example.com/$1 [R,L]

Also, don’t forget to update you wp-config.php file accordingly:
https://docs.bitnami.com/aws/apps/wordpress/administration/configure-domain/

Note: Use

define('WP_SITEURL', 'https://DOMAIN/');
define('WP_HOME', 'https://DOMAIN/');

if you only want to serve it via HTTPS.

Regards

image

It didn’t work, and I can’t find the file either
/opt/bitnami/apps/wordpress/htdocs/wp-config.php

Hi @jselva,

Could you please run the support tool again so we can check the latest status?

Regards

sure

693c22bf-2b8a-0208-bcfe-7a7201166ade

Hello @jselva,

I can access your site correctly:

$ curl -LI flordecana.com
HTTP/1.1 200 OK
Date: Wed, 07 Apr 2021 08:40:49 GMT
Server: Apache
Last-Modified: Tue, 09 Mar 2021 19:39:36 GMT
ETag: "7b9d-5bd1fb5d97c40"
Accept-Ranges: bytes
Content-Length: 31645
Vary: Accept-Encoding
Content-Type: text/html


Could you try this same command? Did you receive the redirections when accessing the main page?

Regards

The redirection happens when I follow the steps to activate the https redirect, the site is in production so I can’t leave it down for a long time.

@davidg

this is the result

Hello @jselva,

Ok, now I fully understand the issue. Could you apply the changes that produce the error, run the support tool again, and share it with us? My suspicion is that there may be another redirection inside <VirtualHost *:443> that could produce the issue.

After that, you can recover the previous files to keep it working.

Regards

@davidg sure

638be2f9-809e-aa96-637a-977026cbe592

Hello @jselva,

I have launched a new machine using your /opt/bitnami/apache2/conf/bitnami/bitnami.conf file and it is working as expected so that file is ok.

As we can see in your screenshots, it is Apache the one that is producing that weird too_many_redirects error. Did you remember to have changed another file? For newer machines, we save the original files and the support tool provides us with the changes that have been implemented, but in your case we don’t have that information.

I have detected these changes on your /opt/bitnami/apps/wordpress/conf/httpd-app.conf file:

#    RewriteEngine On
    #RewriteBase /wordpress/
#    RewriteRule ^index\.php$ - [S=1]
#    RewriteCond %{REQUEST_FILENAME} !-f
#    RewriteCond %{REQUEST_FILENAME} !-d
#    RewriteRule . index.php [L]

Could you change it with the following lines?

    RewriteEngine On
    #RewriteBase /wordpress/
    RewriteRule ^index\.php$ - [S=1]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . index.php [L]

The support of the machine reported that the domain is ec2-X-XXX-XX-XX.compute-1.amazonaws.com, which points to 3.XXX.XX.49. However, I can see that flordecana.com points to 52.201.186.219, as you can see in the link below:

https://www.whatsmydns.net/#A/flordecana.com

Could you double-check what is your instance IP by executing this from your machine?:

curl http://myip.bitnami.com/

Also, it would be great and faster if you could launch a test machine so we can test your Apache changes directly, but up to you.

Regards

@davidg it didn’t work, this is my configuration file /opt/bitnami/apps/wordpress/conf/httpd-app.conf

053c3383-7b93-14ae-67b3-c57e711bba5b

curl http://myip.bitnami.com/

image

Hello @jselva,

Then, you would need to point flordecana.com to your machine IP (3.214.44.49) instead of 52.201.186.219.

Regards

@davidg

but to the ip (3.214.44.49) I do not have external access

image

@davidg

skip previous comment, it was internal problem, I will make the change and try

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.