Support

Admin Tools

#23566 'IcoMoon' font not working properly in backend

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 maggus86 on Tuesday, 27 October 2015 13:16 CDT

maggus86
 Hei Nicholas!

This is Markus from Germany :) There is some curious incident the .htacces maker in the new version 3.6.4.

The 'IcoMoon' font is not being loaded properly when the parameter 'Redirect www and non-www addresses' is set to 'Redirect non-www to www'.

Case 1: I work inside the backend using the url 'http://www.my-domain.de/administrator'
Result: 'IcoMoon' font and icons will be loaded properly.

Case 2: I work inside the backend using the url 'http://my-domain.de/administrator'
Result: 'IcoMoon' font will not be loaded properly and icons will not be displayed.

I suppose the backend tries to open the font file without the www in case 2 and gets no proper result so that the font will not be available... But unfortunately I'm not good enough in coding in order to design a workaround for this incident.

Can you help me maybe?

Yours sincerely,
Markus

nicholas
Akeeba Staff
Manager
Since you've set "Redirect non-www to www" it stands to reason that you MUST visit your site's back-end using the www address. In fact your server should automatically forward you to the www domain name with this option enabled. If this doesn't happen you have misconfigured Joomla!: edit your configuration.php and change $live_site to point to the www address e.g.
public $live_site = 'http://www.example.com';

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!

maggus86
Hei Nicholas!

Thanks a lot for your reply. Well, the redirect from non-www to www addresses works great for the frontend but ... for some reason ... not for the backend.

I have created a second .htaccess and .htpasswd file for the 'administrator' folder via your 'Protect your administrator back-end with a password' function. When deleting these both files again the redirection rules of the root folder also work for the backend.

So should I leave the administrator folder without these both files so that redirection works properly?

Yours sincerely,
Markus

nicholas
Akeeba Staff
Manager
No. You must contact your host immediately! Based on your description of what is going on what happens is NOT standard Apache behavior and a security hole. Please note that the following analysis is based on the assumption that you are right that the .htaccess in the administrator directory "shadows" the .htaccess in the site's root. It's best to ask your host for verification.

The .htaccess files are meant to cascade. This means that if you have a .htaccess file in both the site's root AND the administrator directory Apache is supposed to 1. read and parse the .htaccess file from the site's root 2. read and parse the .htaccess file from the administrator directory 3. merge the parsed results 4. apply the merged rules. What happened on your site is that the .htaccess in the administrator directory shadowed the one in the site's root. This is non-standard and a massive security hole.

Why a security hole? The .htaccess file generated by .htaccess Maker is written to the site's root so it can apply to all subdirectories. On your server, which does NOT work properly, an attacker could exploit a direct file write vulnerability to write a .htaccess file inside a directory that is normally not accessed over the web, e.g. administrator/components/com_messages/tables. Then they could upload a hacking script, such as C99, into that directory. Since the .htaccess file in that directory has overridden the master .htaccess file in the site's root the attacker can access the hacking script despite the Front-end Protection you enabled in .htaccess Maker, therefore bypassing this very important protection for your site. So you end up being unprotected, as if you never had used the .htaccess Maker. That's really bad and I can't understand why any host would choose to break their hosting platform like that!

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!

maggus86
Hei Nicholas!

Thanks a lot for the time you spent to help me with the rewriting module!!

As I mentioned I have both "htaccess maker" and "backend password protection" enabled and I have tested several situations right now.

The inheritance of .htaccess rules is definitely working. But for some reason these BOTH lines in the subfolder .htaccess file cause the fact that the root .htaccess rules will not be processed any more time.

RewriteEngine On
RewriteRule \.htpasswd$ - [F,L]

After deleting both lines out of the subfolder .htaccess file the url will be rewritten correctly :D :D :D

Just one thing left: unfortunately, when calling the url "ruhepotential.de/administrator" in my browser window I need to fill out the authentication window three times:

URL: ruhepotential.de/administrator
AUTHENTICATION - FIRST TIME

Rewritten URL: www.ruhepotential.de/administrator
AUTHENTICATION - SECOND TIME

Rewritten URL: https://www.ruhepotential.de/administrator
AUTHENTICATION - THIRD TIME

>> Backend Login finally appears...

Is there anything I can do to get the URL rewritten before the authentication window appears? I'm quite sure I'm using Apache 2.2 so as far as I know the .htaccess rules of the subfolder will ALWAYS be processed first and after that the root htaccess rules will be processed...

Kindly regards, Markus

nicholas
Akeeba Staff
Manager
Is there anything I can do to get the URL rewritten before the authentication window appears? I'm quite sure I'm using Apache 2.2 so as far as I know the .htaccess rules of the subfolder will ALWAYS be processed first and after that the root htaccess rules will be processed...


That's not accurate. Both are read and parsed BUT the most specific .htaccess (in the administrator directory) gets precedence. This means that if both files contain the same directive with different values the value in the most specific file (administrator/.htaccess) "wins". There is no such thing as "executes first" and "executes last".

For this reason, as long as you have HTTP Basic Authentication set up in the administrator directory this is the first thing Apache will check. It's actually very simple why: you are telling Apache to not serve the request unless it's given the correct HTTP BA header. Browsers cache HTTP BA credentials per protocol, domain, port and directory. First and second URLs differ by domain so it makes sense that you are asked twice. Second and third URLs differ by protocol so it makes sense that you are asked a third time. That's how it's supposed to work.

Simple solution: access https://www.ruhepotential.de/administrator instead of ruhepotential.de/administrator.

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!

maggus86
That's how it's supposed to work.


Good to know that everything's now working properly :D

Thanks a lot for your help, Nicholas!

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!