Support

Admin Tools

#29043 With Admin Tools professional do I need to place .htaccess to other folders?

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 Oh690AnZ on Monday, 05 February 2018 05:56 CST

Oh690AnZ
Please look at the bottom of this page (under Support Policy Summary) for our support policy summary, containing important information regarding our working hours and our support policy. Thank you!

Hello,

I just need some advice or some kind of help. I've been using Akeeba Admin Tools Pro for a very long time and it is great. I'm using the .htaccess maker and my site has .htaccess enhanced or created by the Admin Tool. However I have read an article that I need to place .htaccess to these folders: cache, images, includes, language, libraries, media, modules and plugins. The article recommended putting this on the .htaccess:

<Files *.php>
Deny from all
</Files>

My question is I'm using Akeeba Admin Tools and it has already created an .htaccess for my website do I still need to create .htaccess for those folders mentioned above?

If you think I still need to place .htaccess on those folders, do you recommend placing .htaccess file also in the components folder? Components folder wasn't mention in the article.

nicholas
Akeeba Staff
Manager
My question is I'm using Akeeba Admin Tools and it has already created an .htaccess for my website do I still need to create .htaccess for those folders mentioned above?


No, you don't. Before you shoot yourself in the feet, DO NOT put this .htaccess file in the components directory and ESPECIALLY in the administrator/components directory! The latter will break Joomla! Update and possibly other software including but not limited to Akeeba Backup's integrated restoration (it runs on a directly accessible .php file since, by definition, restoring a backup replaces your Joomla! installation making it impossible to run Joomla! while this is in progress - more on why that's safe later). That's why the author of that article did not tell you to do that. BUT! By not protecting the components folders' files from direct access you are not really adding up to your site's security. I'm afraid the author of that article didn't understand my Master .htaccess file or its fork over at the security page of the Joomla! wiki :)

Don't worry, though. Admin Tools has got your back. The .htaccess Maker has two features "Front-end protection" and "Back-end protection". These features deny access to all .php files (and a bunch of other files) unless explicitly allowed.

The files index.php and administrator/index.php are always allowed as these are the files which server your site's frontend and backend (even when you don't see index.php in the URL, there is some Apache URL rewriting magic behind the scenes). Also, we allow the restore.php files inside the backend folders of Akeeba Backup and Joomla! Update used to restore backups and update Joomla! respectively. This is safe because these files are inert until the point in time where a backup restoration / Joomla! update is taking place and even then they will only respond to encrypted messages with a key known only to the browser used by the Super User carrying out the relevant operation.

Moreover, all other static files are denied access except for very specific file types (CSS, JavaScript, fonts, bitmap images, vector images, videos) in the media directory of your site and inside the component's folders. This prevents access even to language INI files which can be used to indirectly -but accurately- detect the version of installed components. Allowing access only to media files makes that process far less accurate, therefore making it mostly useless to potential attackers, prowling for vulnerable sites.

On top of that, the .htaccess Maker makes it much easier for you to add exceptions to these rules which might be necessary for some extensions' features. For example, some e-commerce applications need to provide callback URLs to third party sites which handle credit card payments. In some cases this is done with bespoke .php files which do load up Joomla! and need to be allowed to be directly accessed. This is something you can't easily do with a bazillion .htaccess files in the components directory.

Executive summary (TL;DR)

  • You don't need to and should not put .htaccess files all over the place.
  • Admin Tools' .htaccess Maker does something even more secure than that.
  • Admin Tools' .htaccess Maker allows you to add exceptions to these rules much easier, without having to deal with locating and editing arbitrary .htaccess files.

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!

Oh690AnZ
Hello,

Thank you so much for that great advice. As usual I always find wonderful support here at Akeeba that is why I keep going back for subscription. Sorry for the late reply I was so busy and got sick because of too much work.

Kind Regards,

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!