Support

Admin Tools

#29790 Files get blocked by htaccess?

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 on Saturday, 07 July 2018 17:17 CDT

jjst135
Hi!

On one of our sites we have an issue with the htacess (created by AdminTools) blocking files.

https://www.pe-veterinair.nl/google64cfb43478d8eb29.html

This gives us a 'forbidden' page.

When we disable the htaccess file (renaming it) the file get's opened OK.

When we use the default htaccess that ships with Joomla we aso can open the file OK. SO I guess the htaccess maker is adding something to cause this.

I compared the settings of the htaccess maker with other sites and I believe they are the same. But I might be missing something...

Any hints on this? Where to look?

I added the htaccess we use on the site (created by AdminTools).

Kind regards,
Jip

jjst135
Mmmm, I compared the settings with an other site, they were the same. BUT the htaccess used on the other site was generated bij AdminTools a while ago...

I noticed these new lines in the htaccess:

# Disallow access to all other front-end folders
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_URI} !^/
RewriteRule .* - [F]

# Disallow access to all other front-end files
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule !^index.php$ - [F]

These are new? I think these might cause the issue of not being able to vie the files in the browser.

Is this intended behaviour? Do we need to manually allow all files / folder we use outside of Joomla folders in the htaccess maker?

Kind regards,
Jip

jjst135
Adding the file to the 'exceptions' also does not seem to help....

jjst135
I've been digging around a bit more....

Adding folder to allow file types (and adding the needed file type) does work to be able to access them from the browser.

When adding a file to the root (public_html) we need to add the file to 'Allow direct access to these files'. In this case the Google verification file. That seems to work.

So in some cases adding a folder + file extension to allow certain file types is one way to go. IN other cases using the 'allow direct access to...' is a way to access files.

Right?

Has there been any changes to how this works in AdminTools lately? I don't believe we had issues like this before. But maybe we have some old htaccess files on our sites...

jjst135
I think I stumbled on this because of another issue not being able to access files in a hidden folder (folder wit a dot in front). I got confused by all the settings in the htaccess maker, but even with the htaccess file disabled the file in the hidden folder was not found by the browser... So this is probably a server configuration issue. I asked my server provider to look into this.

tampe125
Akeeba Staff
Hello,

yes, that's the expected behavior.
In the latest version of Admin Tools, we block all access to static files unless explicitly allowed. This blocks attackers to serve spam or malicious content from your site.
In your case it means that you have to manually exclude the site verification file for Google.

Davide Tampellini

Developer and Support Staff

๐Ÿ‡ฎ๐Ÿ‡นItalian: native ๐Ÿ‡ฌ๐Ÿ‡งEnglish: good โ€ข ๐Ÿ• My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jjst135
OK, thanks Davide. Due to this change we might run into more issues maybe. We'll see.

We now do need to allow access to the error files in the root of all of our websites. We use DirectAdmin and these files are use for server error messages:

400.shtml
401.shtml
403.shtml
404.shtml
500.shtml

But due to the change in AdminTools we now need to add these files as exceptions to the htaccess. Not a big deal, but this change in DirectAdmin does present us with some new challenges ;-) But I guess this new feature makes our website safer. So thats's a good thing.

tampe125
Akeeba Staff
.shtml files are blocked because they allow dynamic content. If an attacker can upload a .shtml file on your site, he can read the contents of other PHP files are raw text (ie the configuration.php file).
You should explicitly allow them or (even better) move them into a specific folder and then allow access to that folder.

Davide Tampellini

Developer and Support Staff

๐Ÿ‡ฎ๐Ÿ‡นItalian: native ๐Ÿ‡ฌ๐Ÿ‡งEnglish: good โ€ข ๐Ÿ• My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jjst135
OK, thanks. I'm not sure if moving these files will work because they are used bij DirectAdmin (path in server settings), but I will ask our server hoster about this.

tampe125
Akeeba Staff
You're welcome!

Davide Tampellini

Developer and Support Staff

๐Ÿ‡ฎ๐Ÿ‡นItalian: native ๐Ÿ‡ฌ๐Ÿ‡งEnglish: good โ€ข ๐Ÿ• My time zone is Europe / Rome (UTC +1)
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

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!