Support

Admin Tools

#43252 htaccess redirect non-www to www : Admin Tools dosen't keep this setting

Posted in ‘Admin Tools for Joomla!’
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

Joomla! version
5.4.7
PHP version
8.3.31
Admin Tools version
7.9.1

Latest post by flodariege on Thursday, 06 August 2026 07:41 CDT

flodariege
Hi,
Although I configured .htaccess Maker to redirect non-www to www, and I get a confirmation message on the screen, this setting is not saved, and Admin Tools reverts to the "Do not redirect" setting.
Screenshots enclosed.
How can I resolve this?

nicholas
Akeeba Staff
Manager

I cannot reproduce this. Does any other option in the .htaccess Maker appears to have the same issue?

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!

flodariege
Honestly, I am new to AdminTools so I have not tried many things. What would you want to to test ?

nicholas
Akeeba Staff
Manager

Literally any option on that page and tell me if your selection stays after you save.

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!

flodariege
I tested Protéger contre le détournement de clic and it seems to work fine.

nicholas
Akeeba Staff
Manager

We think we’ve found the cause. Admin Tools has a safety check: if your site’s configuration.php has the $live_site variable set, and it’s set to a full URL(e.g. https://www.rouchenergies.fr) rather than just being empty, the .htaccess Maker automatically disables the “Redirect www and non-www addresses” option and resets it to “Do not redirect” every time you save — regardless of which direction you pick. This is by design, to prevent an infinite redirect loop between the .htaccess rule and Joomla’s own URL handling when $live_site is hard-coded.

Could you please check your configuration.php file (in your site’s root folder, accessible via FTP or your host’s File Manager) and tell us whether it contains a line like this:

public $live_site = 'https://www.rouchenergies.fr';

If that line is present and not empty, that’s what’s preventing Admin Tools from saving the redirect setting. In that case, the fix is not in Admin Tools — you’d need to either clear the $live_site value (set it to '') or leave the www/non-www redirect handling to be done outside of Admin Tools, since Joomla itself is already enforcing a single canonical URL via $live_site.

Please let us know what you find in that file so we can confirm this is indeed the cause.

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!

flodariege
Hello,
Unfortunately, yes : configuration.php has the $live_site variable set, and it’s set to a full URL : https://www.rouchenergies.fr
This has been done by my hoster (Planet Hoster) when my URL was keeping failing on a 421 error mentioning the temporary URL set during the nameserver change.
If ever I try to clear this line to:
public $live_site = '';
The 421 error occurs again.
It's not you, it's not me, and PlanetHoster keeps telling me it's not them.

However, I did realize yesterday that in Admin Tools / HTaccess maker / System configuration :
Hostname for HTTPS requests (without https://)
and
Hostname for HTTP requests (without http://)
were still both set to the temporary URL !

Obviously, I changed it as soon as I saw it, but is there a slight chance that this obsolete URL can have been kept somewhere in a Admin Tools file?

nicholas
Akeeba Staff
Manager

If you have $live_site you cannot use the non-www to www redirection (or vice versa). Joomla FORCES the domain name in the $live_site. You can't use the non-www to www redirection in that case, which is why your setting is not applied; it is forced to Do Not Redirect as any other option would break your site.

As for HTTP 421, that's the first time you mention it in this ticket. Go to Configure WAF, Request Filtering, and check the Allowed domains option. Try emptying it.

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!

flodariege
My hoster solved the 421 error.
The problem stemmed from a bad entry in AdminTools part of the DB ( xy1z2_admintools_storage ) and the site cache.

So now that I no longer have to worry about the URL with www leading to a 421 error page, I can try clearing the variable in the live_site line again, and then use AdminTools htaccess maker to force the non-www redirection to www.

Otherwise, I'll add the necessary code to the .htaccess file manually.

Thank you

flodariege
Rest of the story:
I have been able to clear the variable in live_site line in configuration.php
So I have been able to activate the option redirect non-www to www in Htaccess Maker
Everything is fine.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!