Multisite - Internal Server Error - exceeded the limit of 10 internal redirects

I have a multisite system that is working fine for most of the sites, except I imported one site into the system, and when I turn on Domain Mapping for that site, it breaks badly and throws internal server errors.

When I turn off domain mapping, the site displays fine. But when I then map the domain the stylesheet and all images are no longer available. The all throw 500 internal server errors. All the other sites in the system still work though.

The error in the logs is:
Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

I understand that normally that's an .htaccess error. But I've found a few more symptoms that are related.

Firstly, on this multisite install I hit a weird bug in Wordpress that means I get an internal server error whenever I try to go to the network dashboard. I can go to the dashboard of any other site on the network, but when I go to the main dashboard it sends me to the wrong link and gives an internal server error.

My network is installed in folder /geektamin/ but shows in the browser at the root (/public_html/)
My network primary domain is
In the navigation, when I click 'Network Admin' > 'Dashboard' Wordpress sends me to which gives an internal server error.

Instead, to get to the dashboard I need to go to

This bug has been reported here:

So to work around this I inserted the function mentioned at the end of that bug report which changes the Network admin URL to include the subfolder. This works well.

However, I think the thing that causes that error may be the same thing I'm struggling with now, but for images and all other assets.

Images Not Working When Domain Mapping Turned On
Here's a specific example.

When I turn domain mapping off the domain is:
The website displays correctly.

Here is the URL of one of the images that displays:

When I turn domain mapping on, the URL becomes:
All the images and stylesheet are then broken.
The website is trying to insert the image with this URL:

But that URL now gives an internal server error -
Request exceeded the limit of 10 internal redirects due to probable configuration error.

But, if I go to this URL, it works:

And if I access that image from the primary network domain, then this URL always gives an internal server error, whether domain mapping is on or off:

And this URL shows the image:

When domain mapping is turned off, the correct stylesheets are inserted:

When the domain mapping is turned on the stylesheets give an internal server error.


So there seems to be a redirecting error that underlies this, that is somehow triggered by the domain mapping plugin? But also had some symptoms there before I even installed the domain mapping plugin (e.g. the Network link being wrong).

My .htaccess file is just the standard multisite code:

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

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) geektamin/$1 [L]
RewriteRule ^(.*\.php)$ geektamin/$1 [L]
RewriteRule . index.php [L]
# END WordPress

Can someone help me out?

If it just too weird to fix, I can delete the site and manually input the articles again (there aren't too many). But I'd like to solve the underlying issue if possible, so that it doesn't pop up again.

Hope someone can help. Thanks!