Support

Admin Tools for WordPress

#42672 DomainRedirect issue in htaccess on multisite

Posted in ‘Admin Tools for WordPress’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

WordPress version
6.9
PHP version
8.3.24
Admin Tools version
1.7.3

Latest post by ChannelDigital on Wednesday, 28 January 2026 01:20 CST

ChannelDigital

All the domains mapped on a WordPress multisite network first started redirecting to the network site, then produced a too many redirects error after saving htaccess Maker.

Comparing with the previous version of the htaccess file (generated by v1.7.2) these lines had been added (using example domain):

# +++DomainRedirect+++ 
## Redirect all alias domains to the canonical domain
RewriteCond %{HTTP_HOST} !^(www.)?abc123.com$ [NC]
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# ---DomainRedirect---

So if xyz321.com was set up on a subsite it would either just get redirected to abc123.com (which may have been a server misconfig or cache issue to begin with), or it would show too many redirects. I can replicate the latter by commenting / uncommenting the lines above.

Where is the setting in htaccess Maker for this domain redirect?

nicholas
Akeeba Staff
Manager

These lines do not come from the code in Admin Tools' .htaccess Maker. I know better than to write this kind of too broad code which will of course break multisite with multiple domains as written. Heck, I am one of few WordPress developers who actually understands that single site, multi-site with subdirectory, multi-site with subdomain, multi-site with domain, and multi-site with a mix of the above are five distinct test cases for WordPress (each test case is the same amount of work as a different version of WordPress as it works differently than the other test cases).

Please remember that unlike Joomla, Admin Tools on WordPress DOES NOT manage the entirety of the .htaccess file by itself. It is only responsible for the section between the markers

# BEGIN AdminTools

and

# END AdminTools

Everything else is managed by something else.

The structure of the WordPress .htaccess is hierarchical. Each plugin's section is placed between a "# BEGIN something" and "# END something" comment.

Within a plugin's section there's subsections. Each subsection is denoted by "+++Whatever+++" (start) and "---Whatever---" (end) markers.

What you showed me looks like the DomainRedirect subsection of a different plugin's section. You need to see which plugin is that by going up until you see its "# BEGIN Something" section marker.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

ChannelDigital

It is within the AT markers, between # ---CommonExploits--- and # +++RewriteBase+++

If AT cannot actually add this code because you haven't written it to do so that's all I need to know, thanks.