@matsumurakenpo
Your configs do seem correct, but in .htaccess
I’d still add two more lines, one on top and one at end, to check whether the mod_rewrite
is even enabled or not
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
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 ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>
Though, it won’t help in your situation since it’s a redirect loop. Can you please confirm that only code written above is there in .htaccess
and not anything else?
In your wp-config.php
file, can you please check if WP_SITEURL
or WP_HOME
constants are defined? If so, can you please remove or comment those lines?
If the redirect loop still continues, it means some plugin or theme code might be causing the redirection, and if they are using wp_redirect
function, we can temporarily stop those redirects by adding this code in active theme’s functions.php
add_filter('wp_redirect', '__return_false');
There are lot more things that can cause the issue, but if you can confirm these three things, we start going through other factors.
Also, ensure to backup your site and database before making changes.
Hello and thanks for the fast reply.
About mod_rewrite
: That is the odd thing, I had to remove those lines, because 1.) That is how I understood the “Network Tutorial” mentioned above (“replacing other WordPress rules:”) and 2. The “My Sites” link was missing.
Interestingly when I add the mod_rewrite
: lines again, the “My Sites” link is still there. Maybe I am missing something about the execution of new lines added in .htaccess
and wp-config.php
. Is there something else to do besides uploading them via FileZilla?
PS: Just to give more details about the error-message. I called it “redirect loop” because firefox-browser is loading endlessly without showing a message. In chromium-browser there is the error-message “ERR_TOO_MANY_REDIRECTS” shown.
If you are talking about the .htaccess
-File and its content. Do you mean more code in the BEGIN WordPress and END WordPress Section. Then the answer is no. The above code is everything. If you mean the file in total, then there is much more. If it helps, I can post the rest.
In my wp-config.php
there are no constants by the name WP_SITEURL
or WP_HOME
.
About the plugins as possible root cause. I have read that several times and that is why I deactivated all of them. But it makes no difference at all.
If I add your line "add_filter('wp_redirect', '__return_false');"
it gets worse, I can’t even log in to the main-sites dashboard (the page is blank).
Found the cause after deleting everything except the Word-Press-Section in the .htaccess
-File:
<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 think that is the default block in the Word-Press-Section, but it was located outside of the BEGIN WordPress and END WordPress comments.
@matsumurakenpo
Thanks for the follow up.
It’s good to know it finally worked out for you 🙂