Support

Admin Tools

#34964 problem with webfont directory

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, 01 May 2021 20:17 CDT

mercurioweb

Hi, I have a problem with a webfont installed on my site.

I setted Admin Tools and the htaccess file, but now the site no longer calls the web font in the "webfont" directory.

I tried to add the exception (see attachments) for this directory but I haven't solved the problem.

Should I set any other settings in admin tools?

nicholas
Akeeba Staff
Manager

Is the folder called webfont? Where is it placed? In your site's root or the administrator directory?  Your screenshots claim it's in both places at the same time which cannot, of course, be true. What is its exact path?

What are the extensions of your files? Case matters. TTF, ttf and Ttf are three different file extensions as far as your server is concerned.

Are the extensions of your files already present in the correct frontend or backend file types allowed in selected directories of .htaccess Maker and in the correct case (as I said: TTF, ttf and Ttf are three different file extensions!).

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!

mercurioweb

Hi, the directory is called webfont and is present in the site root

the extensions of the files in the webfont directory are:
- .eot
- .ttf
- .woff
- .css

all file types are allowed in selected directories

moreover, the activation of the htacess file also blocks the display of the icons in the backend (see attachment)

nicholas
Akeeba Staff
Manager

Your problem is that there is a mismatch in the subdomain you told .htaccess Maker to use and what you are using to access your site.

Check your configuration.php file. If you have a non-empty $live_site there try emptying it. If your site doesn't work with an empty $live_site please make sure that you are using the EXACT protocol and subdomain of your site. The following are four different sites:

  • http://www.example.com
  • http://example.com
  • https://www.example.com
  • https://example.com

Now go back to your .htaccess Maker page. Check what is the "Redirect www and non-www addresses" setting. You must choose something other than "Do not redirect".

Now scroll all the way down and check your "Host name for HTTPS requests (without https://)" and "Host name for HTTP requests (without http://)" settings.

If you chose "Redirect non-www to www" earlier these two domains MUST include the www. subdomain prefix.

If you chose "Redirect www to non-www" earlier these two domains MUST NOT include the www. subdomain prefix.

The technical explanation is that web fonts are static resources. Static resources can only be retrieved from the same domain and protocol as the page which tries to include them. If the protocol or domain (including the subdomain) do not match it's a cross-site request which may be rejected by some browser, most notably Firefox, at the preflight stage of the request i.e. when the browser considers whether to even send the request to the server. That would be why any change in the .htaccess had zero effect; a request was never made by your browser to the server in the first place.

This can happen if you are using the non-www to www redirection (or vice versa) but the canonical domain name you've entered in the .htaccess Maker doesn't match it. For example, if you tell the .htaccess Maker to redirect non-www to www but set the non-www domain name as the canonical all your static resources are now cross-site requests.

Unfortunately this cannot be caught programmatically because there are legitimate if less common use cases which involve a proxy or load balancer where a mismatch between what you enter in the redirect option and what you enter in the domain options are actually necessary.

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!

mercurioweb

thank you, I solved the problem

nicholas
Akeeba Staff
Manager

You're welcome!

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!

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!