Support

Admin Tools

#22929 saving .htaccess 403 error

Posted in ‘Admin Tools for Joomla! 4 & 5’
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
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by dlb on Tuesday, 14 July 2015 15:48 CDT

user72049
 Hi,

I have inherited a site and in working to get it "just right" I cannot save or save and create an .htaccess file without getting a 403 error.

I have ruled out my host because I have no trouble with another site.

I have tried renaming the .htaccess file and .htaccess.admintools files to see if I can just create a new one, but I still get a 403 error. (The current .htaccess file and .htaccess.admintools files were uploaded and manually tweaked to adjust the domain name when saving failed.)

Permissions are good.

I am not sure what else to check.

edit: Joomla 3.4.3

Thanks in advance,
Helen

dlb
Helen,

You need to be a Super Admin in order to save the .htaccess file.

Can you post a screen shot of the error please?


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user72049
Hi Dale,

I am a Super User.

see screen shot for error. Corresponding error in cPanel isn't clear:

2015-07-08 07:52:18.309 [INFO] [76.5.76.244:55259-0#APVH_mydomain.org] File not found [/home/***/public_html/403.shtml]

Should I try a delete and reinstall?

Helen

dlb
The error message that you posted is actually one line off. This is a 404 error where it couldn't find the "pretty" error message for the 403 error.

I have a bit of a wild and crazy idea, go to your Global Configuration, on the System tab, then increase your Session Lifetime value. It is probably 15 minutes, make it 30. If I'm reading the error message correctly, the 403 is on /administrator/index.php. The only way that could happen is if you're not logged in. That would happen if your session expired.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user72049
Hmmm, I had sessions in the database out the wazoo so I purged. Plus, my session lifespan is at 60 already (yeah, I know..). Logged back in but still same error.

I am also missing the "pretty" error message? *sigh*

dlb
Missing the "pretty" error message is VERY common and not all that important. A peaceful mountain background on your 403 error really doesn't help all that much.

Your LiteSpeed server does not support all of the options of the Apache server in the .htaccess file. We need to disable all of the options on the .htaccess Maker page and try to save the file. If that works, we can add them back a little at a time until we figure out which one is causing the problem.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user72049
I have another site on the same server that does not have this issue. And I have all the same options within the .htaccess... accept for a couple that I want to change.

So in the spirit of exasperation, I manually created replacement .htaccess and .htaccess.admintools files, kept the others appending -bak to the name. HOWEVER, the backend still reads the old settings.

So, should I proceed with making everything "No"? Should I replace with the default Joomla .htaccess?

dlb
Marking everything "no" and trying to save the file were instructions from Nicholas. Yes, that is the next step.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user72049
I changed everything to no and it would not save. Same error. :(

dlb
You have two sites on this host, how are the sites arranged? Is the "problem" site in a sub-folder of the "working" site?


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user72049
No, both sites are arranged the same. I have a reseller account with Rochen, so essentially my sites are contained within my own shared space.

To note: on my localserver I do not have this problem with this site.

dlb
I'm not 100% sure of your last answer. What I'm looking for is an .htaccess file that may be inherited by the problem site. Are the sites siblings:
/Site1
 Site2
or parent/child
/Site1/Site2
In the parent/child arrangement, the parent's .htaccess file affects the child site as well. That could account for why you're only having problems with one site. That is not a normal arrangement on a Reseller account, so it is probably a dead end.

Do you see any lines in your error log marked ERROR? It should be near the "missing file" line that you posted earlier. The missing line is a result of the error.

Please disable the plugin System - Admin Tools, then try to save the .htaccess file again. That will turn off the WAF. That shouldn't be the problem. You can enable the plugin again afterwards, we only want it off long enough to test.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user72049
Each site is NOT parent/child but siblings. They each have their own cPanel.

There are no other error lines in the error logs other than what I posted each time you try to save the .htaccess.

I disabled the WAF and tried to save but it threw the same error.

So I put back the Joomla .htaccess file, uninstalled Admin Tools, reinstalled Admin Tools and I get the same error??

This site might need to be rebuilt. It is difficult inheriting a site and straightening it out... :(

What else can I check?

dlb
I need to talk to Nicholas about this again. He is out of town until Tuesday. I'm sorry to make you wait but I don't want to keep jumping you through hoops looking for a solution.

You can save your configuration.php when you modify Global Settings within Joomla!, right? If you can't, that would indicate that you need to enable the FTP layer in Joomla!'s Global Settings because of file ownership issues.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user72049
I can save config file fine. However, I do know another thing that is probably caused by the same issue. If I build a menu to a K2 anything and then try it, I get a 404 error. If I change the config to URL rewrite = No, it works. If I change the URL rewrite back to Yes and wait a day or two, it works. I don't have any caching enabled.

I don't mind trying things or waiting until Nicholas gets back. You are being very patient and I appreciate that. :)

dlb
Helen,

If you use the Preview button in .htaccess Maker, can you copy and paste the lines into your .htaccess file?


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user72049
Preview button didn't work before but now it does. :/

I already have an updated .htaccess file I uploaded from the localserver so it is in place. As well as an updated .htaccess.admintools file.

I am in the midst of a rebuild just in case. :)

dlb
There has to be some difference between the two sites. If you look at the files' owner via FTP or your host's file manager, are all the files owned by the same user? If they are not, that indicates that the site needs Joomla!'s FTP layer to keep the FTP user as owner.

.htaccess Maker is designed to work with Apache servers. It has been modified to support nginx servers. LiteSpeed is an Apache-like server, it isn't Apache. It does not fully support .htaccess and you should get a warning to that effect when you use .htaccess Maker on LiteSpeed.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user72049
Upon first glance, the broken site uses MySQL database and the working site uses MySQLi database. Both use Joomla's FTP layer off.

I have to admit I do not understand file ownership. I do understand file permissions. So what am I looking for?

dlb
See attached. :-)

This is the Remote window from the FileZilla FTP client. The owner number itself isn't important, that would change with every server and every account. But the number should be the same for all of the folders and files. The number relates to a user on the server.

Some server setups use a different user for the web user and FTP user. This can lead to 403 errors since the access is no longer using the first number (owner) but the second (group) or third (world) in the 755 permissions.

There is further documentation section is here: https://www.akeebabackup.com/documentation/akeeba-backup-documentation/how-your-web-server-works.html. It is not an easy read, it usually takes a couple of times before it sinks in.


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

user72049
It all looked good but I had Rochen reset the ownership of all just in case. However, I still have the same error.

user72049
Got it working!

My ModSecurity had blocked the action and Rochen whitelisted the rule that was triggering the block.

Thank you Dale for all your help with this.

It takes a village to raise a child!

dlb
You're welcome!

I'm glad you figured it out!


Dale L. Brackin
Support Specialist


us.gifEnglish: native


Please keep in mind my timezone and cultural differences when reading my replies. Thank you!


????
My time zone is EST (UTC -5) (click here to see my current time in Philadelphia, PA)

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!