Hiding the login URL of the Joomla 4.0 site, like AdminExile Topic is solved

This forum is for general questions about extensions for Joomla! 4.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
jtalbot
Joomla! Apprentice
Joomla! Apprentice
Posts: 26
Joined: Mon Jan 26, 2009 3:44 am

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by jtalbot » Sun Dec 11, 2022 2:11 pm

toivo wrote:
Sun Nov 27, 2022 1:50 am
I agree with @AMurray, any issues like a 404 error are due to the configuration of the server. The Directory Privacy option works all right with websites hosted for example by Rochen.
Thanks for the response.

To further investigate this, I created another directory on the web site /testprotected (since the directory privacy stuff *did* work fine on the site's main directory), used cpanel's Directory privacy to create an .htaccess file in that directory (it ends up being very similar to .htaccess files suggested in this thread), turned off SEF urls in Joomla, and disabled the site's .htaccess file, and then I am correctly prompted for username/password when accessing that directory. After a bit more experimentation, I figured out that the mod_rewrite section of the site's .htaccess file is what is interfering with directory privacy (i.e., if I remove that section only from .htaccess then directory privacy works fine; if I put it back, directory privacy doesn't work - i.e., I get a 404 error as per my previous post).

I think the mod_rewrite section I'm using is just the one that came with the Joomla 4 installation:

Code: Select all

## These directives are only enabled if the Apache mod_rewrite module is enabled
<IfModule mod_rewrite.c>
	RewriteEngine On

	## Begin - Rewrite rules to block out some common exploits.
	# If you experience problems on your site then comment out the operations listed
	# below by adding a # to the beginning of the line.
	# This attempts to block the most common type of exploit `attempts` on Joomla!
	#
	# Block any script trying to base64_encode data within the URL.
	RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
	# Block any script that includes a <script> tag in URL.
	RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
	# Block any script trying to set a PHP GLOBALS variable via URL.
	RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
	# Block any script trying to modify a _REQUEST variable via URL.
	RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
	# Return 403 Forbidden header and show the content of the root home page
	RewriteRule .* index.php [F]
	#
	## End - Rewrite rules to block out some common exploits.

	## Begin - Custom redirects
	#
	# If you need to redirect some pages, or set a canonical non-www to
	# www redirect (or vice versa), place that code here. Ensure those
	# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
	#
	## End - Custom redirects
  
	##
	# Uncomment the following line if your webserver's URL
	# is not directly related to physical file paths.
	# Update Your Joomla! Directory (just / for root).
	##

	# RewriteBase /

	## Begin - Joomla! core SEF Section.
	#
	# PHP FastCGI fix for HTTP Authorization, required for the API application
	RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
	# -- SEF URLs for the API application
	# If the requested path starts with /api, the file is not /api/index.php
	# and the request has not already been internally rewritten to the
	# api/index.php script
	RewriteCond %{REQUEST_URI} ^/api/
	RewriteCond %{REQUEST_URI} !^/api/index\.php
	# and the requested path and file doesn't directly match a physical file
	RewriteCond %{REQUEST_FILENAME} !-f
	# and the requested path and file doesn't directly match a physical folder
	RewriteCond %{REQUEST_FILENAME} !-d
	# internally rewrite the request to the /api/index.php script
	RewriteRule .* api/index.php [L]
	# -- SEF URLs for the public frontend application
	# If the requested path and file is not /index.php and the request
	# has not already been internally rewritten to the index.php script
	RewriteCond %{REQUEST_URI} !^/index\.php
	# and the requested path and file doesn't directly match a physical file
	RewriteCond %{REQUEST_FILENAME} !-f
	# and the requested path and file doesn't directly match a physical folder
	RewriteCond %{REQUEST_FILENAME} !-d
	# internally rewrite the request to the index.php script
	RewriteRule .* index.php [L]
	#
	## End - Joomla! core SEF Section.
</IfModule>
Are you able to duplicate the issue I'm experiencing, and if so, could you please help me figure out how this SEF section could be modified to allow for directory privacy of subdirectories?

Thanks.

User avatar
adrian_vg
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Wed Apr 23, 2014 3:06 pm
Location: Sweden

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by adrian_vg » Thu Feb 09, 2023 12:32 pm

AMurray wrote:
Mon Aug 23, 2021 9:51 pm
I hope that's not your REAL "secret" code you just posted in a PUBLIC forum!

As to .htaccess protection Admin Tools does that as well- Core version should do both the 'secret key' and htaccess /administrator folder protection. That's the top 2 features I use it for.
Hello!

This "secret key" thing in Admin Tools Core, where is it?

I only have "Main Password" and "Password-protect Administrator" in the Security field on my install.
See attached pic.
2023-02-09_13-33-52.png
I currently use the "Password-protect Administrator" feature which shows a prelogin-popup before showing the normal Joomla 4 admin-login.
You do not have the required permissions to view the files attached to this post.
--
//AvG

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9874
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by AMurray » Thu Feb 09, 2023 9:35 pm

I am guessing the secret key function is a Pro feature. Under Firewall configuration.
Regards - A Murray
General Support Moderator

User avatar
adrian_vg
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Wed Apr 23, 2014 3:06 pm
Location: Sweden

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by adrian_vg » Fri Feb 10, 2023 7:40 am

AMurray wrote:
Thu Feb 09, 2023 9:35 pm
I am guessing the secret key function is a Pro feature. Under Firewall configuration.
Aha, thanks.
Assumed it was in the Core as well, as it was mentioned to be there. :-)

I'll see if I can find a comparison table with this info.

Update
Yeah, it's a Pro feature!
"Administrator secret URL parameter"; https://www.akeeba.com/products/admin-tools.html.
--
//AvG

Ozmoz
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed Jan 01, 2014 3:19 pm

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by Ozmoz » Sun Feb 12, 2023 9:59 am

IvanVk wrote:
Sun Aug 22, 2021 12:22 pm
I found a temporary solution.
In the '.htaccess' file after "RewriteEngine On" I added code below

Code: Select all

##Blocking access to the web administrator eg http://www.site.com/administrator
RewriteRule (^|/)administrator(/|$) - [F]
In my testing , this code prevents access to the administrator panel on the website.
Since I access once every two weeks, this meets my needs.
This is a temporary solution until the author of "AdminExile" publishes a newer version for Joomla 4x.

It is not difficult for me to make changes to the ".htaccess" file once or twice in two weeks, when I want to access the 'Joomla Admin CP' on the website. It takes 1 minute.

So when I want to access 'Joomla Admin CP' on a website, I simply add a comment (in '.htaccess' file) in front, so it looks like this (#RewriteRule (^|/)administrator(/|$) - [F])

I hope this helps other forum members as well.
Thanks for the info. I never thought about doing this. I've just been using the Brute Force Stop extension.

Upon a google search I used the following code in my .htaccess file which then means I don't have to REM it out to access my Joomla backend since I have a static IP for the "Allow from" bit.

(.htaccess file placed in Joomla's Administrator directory)

Code: Select all

ErrorDocument 403 http://www.your-ip-is-not-allowed-to-access-this-section.com
Order deny,allow
Deny from all
Allow from x.x.x.x
Seems to work, unless this newbie is missing something? :-)

Cheers,
Oz

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 31063
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by Per Yngve Berg » Sun Feb 12, 2023 10:46 am

Have you considered using One Time Passwords for the Users that have access to the Administrator?

User avatar
Nidzo2203
Joomla! Explorer
Joomla! Explorer
Posts: 324
Joined: Sat Nov 21, 2009 4:52 pm
Contact:

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by Nidzo2203 » Fri Feb 17, 2023 6:13 pm

AdminExile does NOT support Joomla 4!

FelixJoomla
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Nov 14, 2008 9:14 am

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by FelixJoomla » Fri Mar 31, 2023 11:16 am

Nidzo2203 wrote:
Fri Jun 17, 2022 10:26 am
ghepardus wrote:
Mon Oct 04, 2021 6:30 am
To make it work version plg_sys_adminexile-3.16.3 with joomla 4.0.3 I modified the following:

adminexile.php
line 29 : $this->_app->isAdmin() --> $this->_app->isClient('administrator')
line 30 : $this->_app->isSite() --> $this->_app->isClient('site')
line 40 : $this->_app->isSite() --> $this->_app->isClient('site')
line 46 : $this->_app->isSite() --> $this->_app->isClient('site')
line 48 : $this->_app->isAdmin() --> $this->_app->isClient('administrator')

adminexile.xml
line 75 : type="usergroup" --> type="usergrouplist"
line 89 : type="usergroup" --> type="usergrouplist"
Long time AdminExile user on J3.
I change code exactly, admin interface doesn't show errors but I can still access backend with /administrator url!?
Joomla 4.1.4

EDIT: It works only if Counterfeit 404 is selected. Doesn't work with Homepage and Custom destination option.
For homepage redirect working again change in adminexile.php
line 106 : break; --> die();

itgurujay
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Mar 19, 2018 9:36 pm

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by itgurujay » Sun Jun 18, 2023 4:42 pm

Use AskMyAdmin for Joomla 4 folks. Works EXACTLY like AdminExile does.
site+keypair in the URL.

https://extensions.joomla.org/extension/askmyadmin/

jswebdesign
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Fri Jan 06, 2006 11:51 pm
Location: Wemeldinge Netherlands
Contact:

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by jswebdesign » Sun Jun 18, 2023 8:02 pm

System - Block Access works

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 9874
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by AMurray » Sun Jun 18, 2023 10:12 pm

That "askmyadmin" extension is coming up on 5 years old. (last JED listing, 2019). AdminExile while only for J3, last JED posting was June 2022.

But I'm sure I've seen on this forum a member had made AdminExile work on J4 (just can't find it searching the forum posts).

Here's one similar to AdminExile that's a bit newer (at least according to the JED listing):
https://extensions.joomla.org/extension/asm-no-admin/ (from 2021).

The only thing that can't be done is literally change the directory /administrator to something else entirely. (AdminTools Pro makes that clear; it provides such an option, but doesn't recommend it, and doesn't support it if something breaks - basically use at your own risk).
Regards - A Murray
General Support Moderator

User avatar
razor7
Joomla! Explorer
Joomla! Explorer
Posts: 378
Joined: Wed Aug 24, 2005 2:06 pm
Location: Argentina
Contact:

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by razor7 » Mon Dec 18, 2023 7:46 pm

Hi! uploading installer with minor tweaks suggested by JED Checker, I confirm it's compatible with J5 and doesn't need the B/C plugin
You do not have the required permissions to view the files attached to this post.
Visit http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more! http://www.mgscreativa.com/contenidos/i ... Itemid=214

User avatar
adrian_vg
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Wed Apr 23, 2014 3:06 pm
Location: Sweden

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by adrian_vg » Tue Dec 19, 2023 6:42 am

razor7 wrote:
Mon Dec 18, 2023 7:46 pm
Hi! uploading installer with minor tweaks suggested by JED Checker, I confirm it's compatible with J5 and doesn't need the B/C plugin
Nice, thanks!
Will try it shortly.
--
//AvG

User avatar
Nidzo2203
Joomla! Explorer
Joomla! Explorer
Posts: 324
Joined: Sat Nov 21, 2009 4:52 pm
Contact:

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by Nidzo2203 » Mon Dec 25, 2023 2:00 pm

razor7 wrote:
Mon Dec 18, 2023 7:46 pm
Hi! uploading installer with minor tweaks suggested by JED Checker, I confirm it's compatible with J5 and doesn't need the B/C plugin
I found that Counterfeit 404 is the only option that works. Other Failure Response options (Homepage and Custom Destination) leads to administrator login page.

I will stick with GoTo Admin

User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2655
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by JAVesey » Mon Dec 25, 2023 6:53 pm

razor7 wrote:
Mon Dec 18, 2023 7:46 pm
Hi! uploading installer with minor tweaks suggested by JED Checker, I confirm it's compatible with J5 and doesn't need the B/C plugin
Thank you for this, razor7 - good to know.

I’m having issues with AskMyAdmin on J5, particularly with disabling/uninstalling. Will switch to AdminExile .v4.0.0 (set to Counterfeit 404) and will test “homepage” edit mentioned earlier :geek:
John V
Cardiff, Wales, UK
Joomla 5.1.1 "live" site on PHP 8.2.15 and MariaDB 10.11.7 (with b/c plugin enabled)
Joomla 5.1.1 on XAMMP for MacOS with PHP 8.2.4 and MariaDB 10.4.28 (with b/c plugin enabled)

User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2655
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by JAVesey » Mon Dec 25, 2023 11:42 pm

FelixJoomla wrote:
Fri Mar 31, 2023 11:16 am
For homepage redirect working again change in adminexile.php
line 106 : break; --> die();
break; appears 3 times in that file, each associated with one of the options. None is at line 106 in the v4.0.0 download from razor7 linked above in this thread.

Did you change all three, or just one in particular?

Very many thanks :)
John V
Cardiff, Wales, UK
Joomla 5.1.1 "live" site on PHP 8.2.15 and MariaDB 10.11.7 (with b/c plugin enabled)
Joomla 5.1.1 on XAMMP for MacOS with PHP 8.2.4 and MariaDB 10.4.28 (with b/c plugin enabled)

User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2655
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by JAVesey » Tue Dec 26, 2023 11:01 am

razor7 wrote:
Mon Dec 18, 2023 7:46 pm
Hi! uploading installer with minor tweaks suggested by JED Checker, I confirm it's compatible with J5 and doesn't need the B/C plugin
@razor7
Does the download link in your post include the "minor tweaks", please?
John V
Cardiff, Wales, UK
Joomla 5.1.1 "live" site on PHP 8.2.15 and MariaDB 10.11.7 (with b/c plugin enabled)
Joomla 5.1.1 on XAMMP for MacOS with PHP 8.2.4 and MariaDB 10.4.28 (with b/c plugin enabled)

User avatar
razor7
Joomla! Explorer
Joomla! Explorer
Posts: 378
Joined: Wed Aug 24, 2005 2:06 pm
Location: Argentina
Contact:

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by razor7 » Tue Dec 26, 2023 4:18 pm

Yes, and this new version is more J5 optimized and I also tested all fail methods and confirm all works. AdminExile sets a session var the first time you access /administrator/?KeyYouSet, after that, you need to clean cookies and session data to be able to test other fail methods
You do not have the required permissions to view the files attached to this post.
Visit http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more! http://www.mgscreativa.com/contenidos/i ... Itemid=214

User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2655
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by JAVesey » Tue Dec 26, 2023 4:41 pm

razor7 wrote:
Tue Dec 26, 2023 4:18 pm
Yes, and this new version is more J5 optimized and I also tested all fail methods and confirm all works. AdminExile sets a session var the first time you access /administrator/?KeyYouSet, after that, you need to clean cookies and session data to be able to test other fail methods
Thank you so much for this, and when you should be relaxing :geek:

The earlier version had issues with the fail methods and I uninstalled it for that reason. I’ll test this later today/tomorrow and report back :)

You are a star!
John V
Cardiff, Wales, UK
Joomla 5.1.1 "live" site on PHP 8.2.15 and MariaDB 10.11.7 (with b/c plugin enabled)
Joomla 5.1.1 on XAMMP for MacOS with PHP 8.2.4 and MariaDB 10.4.28 (with b/c plugin enabled)

Pranav1
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sun Nov 26, 2023 10:37 am

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by Pranav1 » Wed Dec 27, 2023 8:05 am

Per Yngve Berg wrote:
Sun Feb 12, 2023 10:46 am
Have you considered using One Time Passwords for the Users that have access to the Administrator?
I think
Using One Time Passwords for Administrator access is a wise security precaution. It adds an extra layer of security, improving overall system security.

User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2655
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by JAVesey » Sun Jan 21, 2024 9:27 am

JAVesey wrote:
Tue Dec 26, 2023 4:41 pm
razor7 wrote:
Tue Dec 26, 2023 4:18 pm
Yes, and this new version is more J5 optimized and I also tested all fail methods and confirm all works. AdminExile sets a session var the first time you access /administrator/?KeyYouSet, after that, you need to clean cookies and session data to be able to test other fail methods
Thank you so much for this, and when you should be relaxing :geek:

The earlier version had issues with the fail methods and I uninstalled it for that reason. I’ll test this later today/tomorrow and report back :)

You are a star!
Sorry, I'm very slow reporting back :-[

This does indeed work as intended (thank you @razor7). Fail methods work provided that only the the "URL access key" is set. I'll be messaging @razor7 privately to advise of an issue when using the "value", i.e. "key + vale" combo. The issue might be me doing something wrong, of course, hence the PM rather than post on here.

But yes, I'm using it successfully on my site :D
John V
Cardiff, Wales, UK
Joomla 5.1.1 "live" site on PHP 8.2.15 and MariaDB 10.11.7 (with b/c plugin enabled)
Joomla 5.1.1 on XAMMP for MacOS with PHP 8.2.4 and MariaDB 10.4.28 (with b/c plugin enabled)

User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2655
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by JAVesey » Tue Jan 23, 2024 1:28 pm

JAVesey wrote:
Sun Jan 21, 2024 9:27 am
The issue might be me doing something wrong, of course, hence the PM rather than post on here.
It was more a case of me not fully understanding how AdminExile works and how it sets cookies :laugh:

All is well and I'm using v4.1.0 on my J5.0.2 site :D
John V
Cardiff, Wales, UK
Joomla 5.1.1 "live" site on PHP 8.2.15 and MariaDB 10.11.7 (with b/c plugin enabled)
Joomla 5.1.1 on XAMMP for MacOS with PHP 8.2.4 and MariaDB 10.4.28 (with b/c plugin enabled)

nrawling
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed May 01, 2024 7:42 am

Re: Hiding the login URL of the Joomla 4.0 site, like AdminExile

Post by nrawling » Wed May 01, 2024 8:55 am

Hello! Can you also update version AdminExile 2.3.6 which works very well with J3?
plg_adminexile_2016_02_06.zip
You do not have the required permissions to view the files attached to this post.


Post Reply

Return to “Extensions for Joomla! 4.x”