WordPress MultiSite infinite redirect

< 1 min read
By - Nov 21, 2018

I was recently setting up a WordPress MultiSite to use subdirectories. All looked good until I tried to visit a newly created site on the network. It was just an infinite look of redirects. 

The how behind why this is happening is explained really well in Tom McFarlin’s post here: https://tommcfarlin.com/resolving-the-wordpress-multisite-redirect-loop/ 

Basically, WordPress gets tied in a knot about where to look for what. 

The fix is actually quite simple Go to your .htaccess file and replace everything between “# BEGIN WordPress” and “# END WordPress”

With 

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L]
RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress

view raw
.htaccess
hosted with ❤ by GitHub

And there you go