Melodia
2 months ago

How to fix 302 too many redirects

Posted 2 months ago by Melodia

I have a website with multisite set to true.

I can see all the pages regardless of the language, however, If I am on the dashboard, and hover over my sites, I cant see any of the dashboards of the other languages.

After a few seconds a see an error that says too many redirects.

If I inspect the page and view the network tab, I see a 302 error.

I have this in my configuration:

define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false); // Set to false if you selected the "Sub-directories" installation.
define('DOMAIN_CURRENT_SITE', 'localhost');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

/*----------------------------------------------------*/
// Authentication unique keys and salts
/*----------------------------------------------------*/
/*
 * @link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service 
 */
define('AUTH_KEY',         'i7a3cyhnq7r89qtnr87639nf70wq3tyy0w9fny089q3fyw78yn0987fcwy890');
define('SECURE_AUTH_KEY',  'io7scyo7fystyf98st86rcts6er7te67ctsert676erctse7r6ts76etv76tr');
define('LOGGED_IN_KEY',    'ij8sddufs8yf657s4c57sfrt8697rf9fn89jsu094s8uf09488us4f089yu0v');
define('NONCE_KEY',        'sdaf8yv65643v5ft68suvs9cu9p0w349u90-48u489wy98fu984f98euf9889');
define('AUTH_SALT',        '9z08jxe6h789mn8b67c8n7xm893n280n7c4mx9cn749mx89cn78438m02n9c7');
define('SECURE_AUTH_SALT', '21333333333780v465bn87b698n7ewc8n48fu848c4mncf4u84wfcum84f4cw');
define('LOGGED_IN_SALT',   'yr5bt3268mu30mu89248mufxy79ny79x9m89u2mu892dxm8u9d2xmu89dx298');
define('NONCE_SALT',       '4e6r57t8yz9u80t6y79n8b6t7rzmy890nxg8zhm0x79gnhmz280gx7989898y');

/*----------------------------------------------------*/
// Custom settings
/*----------------------------------------------------*/
define('WP_AUTO_UPDATE_CORE', false);
define('DISALLOW_FILE_EDIT', true);
define('WP_DEFAULT_THEME', 'themosis-theme');

Inside the htaccess I have this:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) cms/ [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ cms/ [L]
RewriteRule . index.php [L]

Options -Indexes

I noticed that there a several question on the web about the same issue, which didn't resolve my issue, so I thought best to also post what I currently have in my users table:

MariaDB [theme]> select * from wp_options limit 10;
+-----------+--------------------+------------------------------+----------+
| option_id | option_name        | option_value                 | autoload |
+-----------+--------------------+------------------------------+----------+
|         1 | siteurl            | http://localhost/cms         | yes      |
|         2 | home               | http://localhost             | yes      |
|         3 | blogname           | Themename                | yes      |
|         4 | blogdescription    |                              | yes      |
|         5 | users_can_register | 0                            | yes      |
|         6 | admin_email        | [email protected] | yes      |
|         7 | start_of_week      | 1                            | yes      |
|         8 | use_balanceTags    | 0                            | yes      |
|         9 | use_smilies        | 1                            | yes      |
|        10 | require_name_email | 1                            | yes      |
+-----------+--------------------+------------------------------+----------+
10 rows in set (0.00 sec)

NOTE: The site was installed with docker, so the file structure does not look exactly the same like in regular WordPress sites.

From the root directory, my site sits under htdocs/content/themes/themename

To login to the main dashboard, I type: localhost/cms/login

MORE INFO: This is a WordPress site that uses themosis framework, which is based on Laravel, however, during all this time I am spedning to try to fix this, I noticed that this is very likely to do with the htaccess. As a matter of fact, If I inspect my network tab, I see a 302 error that fires of about 8 times.

How can I view the dashboard for the other languages?

Please sign in or create an account to participate in this conversation.