Chat with us, powered by LiveChat
Home  /  Blog  /  News  /  The protection of Joomla admin folder returns 404 error

The protection of Joomla admin folder returns 404 error

The Protection of Joomla admin folder returns 404 errorAll the websites created with Joomla! CMS or WordPress and occasionally PHP, are always protected at the administrator folder level from cPanel or Plesk. This consists one of the most important rules of our security. Here is an example of how the error can be encountered. Recently, we installed the components Sh404sef and Admin Tools, for SEO and security purposes on a client’s website. However, when the client visited the admin page, e.g. http://www.domain-name.com/administrator/ the page error 404 – page not found occurred.

After the deletion of the .htaccess file from the admin folder, the Joomla Admin Panel worked without any issues and the 404 page error didn’t re-occurred. This proves that the initial error didn’t conflict with sh404 SEF and Joomla Admin Tools, but there was possibly a syntax error in the .htaccess file.

However, we carried out further investigation for this issue and we concluded that an extra line will need to be inserted in the file “/public_html/administrator/.htaccess”. The new entry is as follows: “ErrorDocument 401 “Authorisation Required”. This is a requirement as per Apache standards (Apache is looking for the 401 error document when using .htpasswd, therefore it needs to be explicitly specified in the website’s code).

Please find below the correct syntax for the designated code:

Before (404-error):

AuthName "Authorisation Required"
AuthUserFile "/home/acc/.htpasswds/public_html/administrator/passwd"
AuthType Basic
require valid-user

After (200-correct):

AuthName "Authorisation Required"
AuthUserFile "/home/acc/.htpasswds/public_html/administrator/passwd"
AuthType Basic
require valid-user
ErrorDocument 401 "Authorisation Required"

If you have any further questions or any difficulties with the suggested solution above, please contact us via the comments form below.

Leave a Reply

Your email address will not be published. Required fields are marked *

We are a young team of professionals and internet lovers who specialise in the development of professional websites and premium plugins for WordPress and Joomla! CMS.
Copyright © 2019 Web357. All Rights Reserved.
Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries.
Web357 is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.