WordPress Multisite ERR_TOO_MANY_REDIRECTS AWS

Keywords: WordPress Multisite - AWS - Technical issue - Secure Connections (SSL/HTTPS)
bnsupport ID: 9b472a9c-a659-8e24-d236-30d8a3320c93
Description:
I’m in AWS.

I followed the tutorial to configure multiple domains using ssl in Apache:
https://docs.bitnami.com/general/apps/wordpress-multisite/administration/use-different-ssl-certificates/
But I have a problem with the main domain, so I can’t access / wp-admin
I changed the .htaccess, it includes the path to Let’s Encripty certifications, but the files are in a different place than suggested in the documentation.
.htaccess>

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^ index \ .php $ - [L]
RewriteRule. /index.php [L]
# add a trailing slash to / wp-admin
RewriteRule ^ ([_ 0-9a-zA-Z -] + /)? Wp-admin $ $ 1wp-admin / [R = 301, L]
RewriteCond% {REQUEST_FILENAME} -f [OR]
RewriteCond% {REQUEST_FILENAME} -d
RewriteRule ^ ([_ 0-9a-zA-Z -] + /)? (Wp- (content | admin | includes). *) $ 2 [L]
RewriteRule ^ ([_ 0-9a-zA-Z -] + /)? (. * \. Php) $ $ 2 [L]
# BEGIN rlrssslReallySimpleSSL rsssl_version [3.3.5]
# <IfModule mod_rewrite.c>
RewriteCond% {HTTPS}! = On [NC]
#wpmu rewritecond pequeninosfest.com
RewriteCond% {HTTP_HOST} ^ little onesfest \ .com [OR]
RewriteCond% {HTTP_HOST} ^ www \ .pequeninosfest \ .com
#end wpmu rewritecond teenyfest.com
RewriteRule ^ (. *) $ Https: //% {HTTP_HOST} / $ 1 [R = 301, L]
</IfModule>
# END rlrssslReallySimpleSSL

# END WordPress

wp-config.php>

/ * That's all, stop editing! Happy publishing. * /
define ('MULTISITE', true);
define ('SUBDOMAIN_INSTALL', true);
$ base = '/';
define ('DOMAIN_CURRENT_SITE', 'pequeninosfest.com');
define ('PATH_CURRENT_SITE', '/');
define ('SITE_ID_CURRENT_SITE', 1);
define ('BLOG_ID_CURRENT_SITE', 1);
# start: fixes for cookies issues with multiple domains
define ('COOKIE_DOMAIN', '');
define ('ADMIN_COOKIE_PATH', '/');
define ('COOKIEPATH', '/');
define ('SITECOOKIEPATH', '/');
# end: fixes for cookies issues with multiple domains
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Apache configuration>

<VirtualHost *:80>
    ServerName pequeninosfest.com
    ServerAlias www.pequeninosfest.com
    DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"

    Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:443>
    ServerName pequeninosfest.com
    ServerAlias www.pequeninosfest.com
    DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
    SSLEngine on
    SSLCertificateFile "/opt/bitnami/letsencrypt/certificates/pequeninosfest.com.crt"
    SSLCertificateKeyFile "/opt/bitnami/letsencrypt/certificates/pequeninosfest.com.key"

    Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:80>
    ServerName pqninos.com
    ServerAlias www.pqninos.com
    DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"

    Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
</VirtualHost>

<VirtualHost *:443>
    ServerName pqninos.com
    ServerAlias www.pqninos.com
    DocumentRoot "/opt/bitnami/apps/wordpress/htdocs"
    SSLEngine on
    SSLCertificateFile "/opt/bitnami/letsencrypt/certificates/pqninos.com.crt"
    SSLCertificateKeyFile "/opt/bitnami/letsencrypt/certificates/pqninos.com.key"

    Include "/opt/bitnami/apps/wordpress/conf/httpd-app.conf"
</VirtualHost>

Bitnami applications installed in a Virtual Host>

Bitnami applications installed in a Virtual Host

Include "/opt/bitnami/apps/wordpress/conf/httpd-vhosts.conf"

Hello @helder_rangel,

I can see https://pqninos.com/wp-admin and pequeninosfest.com are suffering from redirection issues. Did you check this documentation to set your primary domain?
https://docs.bitnami.com/general/apps/wordpress-multisite/configuration/configure-wordpress-multisite/

Which is your primary domain in this case? It seems to be pqninos.com but you have pequeninosfest.com in your wp-config.php file.

Apart from that, the .htaccess code you pasted seems to have syntax issues (I guess it is probably an error during the copy). Could you paste it again between using preformatted text. Take into account that .htaccess files are disabled by default. You can get more info in the link below:
https://docs.bitnami.com/aws/apps/redmine/administration/use-htaccess/

I have also seen you are using sslReallySimple. Let me share with you a previous redirections issue with that plugin:

https://community.bitnami.com/t/getting-302-301-redirect-at-the-same-time-which-htaccess-files-should-i-amend-for-it-to-take-effect/87589

Regards

#htaccess >

BEGIN WordPress

The directives (lines) between “BEGIN WordPress” and “END WordPress” are

dynamically generated, and should only be modified via WordPress filters.

Any changes to the directives between these markers will be overwritten.

RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteRule . /index.php [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] # BEGIN rlrssslReallySimpleSSL rsssl_version[3.3.5]

RewriteCond %{HTTPS} !=on [NC]
#wpmu rewritecond pequeninosfest.com
RewriteCond %{HTTP_HOST} ^pequeninosfest.com [OR]
RewriteCond %{HTTP_HOST} ^www.pequeninosfest.com
#end wpmu rewritecond pequeninosfest.com
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

END rlrssslReallySimpleSSL

END WordPress

Hello @helder_rangel,

When copy code here, please format your code to make it readable. It is preferable you run the support tool again and share the new ID so we can check all the files.

Could you let us know which is your primary domain?

Regards

pequeninosfest.com is primary, I add other to use multiples domains, remove pqninos.com of apache virtual host?

3d897031-b46c-5fc3-cf91-5ab9094ce531
To be legible, just remove “#”?

Hi @helder_rangel,

Thanks for the new bnsupport code. I see the pequeninosfest.com domain is properly set in the wp-config.php file

define( 'DOMAIN_CURRENT_SITE', 'pequeninosfest.com' );

Can you check the values in the database?

sudo mysql -u bn_wordpress -p -e "USE bitnami_wordpress; SELECT option_name,option_value FROM wp_options WHERE option_name='siteurl' OR option_name='home';

sudo mysql -u bn_wordpress -p -e "USE bitnami_wordpress; SELECT domain FROM wp_blogs WHERE blog_id = '1';

To properly format the code, you need to use three backsticks ( ` ) at the beginning and end of your code to format. Please check the next schema

(three backsticks here)
your text to be formated
(three backsticks here)
option_name='siteurl' OR option_name='home';```
```home
https://pequeninosfest.com
siteurl
https://pequeninosfest.com

Hi @helder_rangel,

Thanks for sharing the output. According to it, the pqninos.com is set as the primary domain in the wp_blogs table. Can you update it to pequeninosfest.com to match the values in the wp-config.php file and the database?

Sucess! Thanks, now I can take acess for wp-admin. Great.

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