Post by v-v » Thu Jun 07, 2018 7:03 pm

Hi,
may I ask someone here for help with font awesome - I have created a domain alias, everything works fine but fonts awesome is shown as rectangles. Any idea? Thank you.

v-v
Active Member

Posts

Joined
Wed Jun 16, 2010 10:09 pm

Post by cyclops12 » Fri Jun 08, 2018 2:07 am

Probably a www or non www redirect problem

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by IP_CAM » Fri Jun 08, 2018 2:13 am

Well, to see the FontAwesome Icons, the URL of an OC-Site
needs to be called in the way, matching the settings in the config.php
files, like either: http(s): // yourshop or then: http(s): //www. yourshop
---
And to make sure, that ANY Site Call will be (re-)directed, to match this, some .htaccess
Content needs to be added, in one of many ways, like shown below, with differently
coded Routines, to achieve such:

Code: Select all

# Remove www. from any domain query
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1%{REQUEST_URI} [R=301,L]
---
# All broswer request get redirected to HTTPS
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
---
#Force non www. to http://www. ( needs to be rewritten, if HTTPS is used )
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
---
#Force (http host) non www to www
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
---
# Redirect to www RewriteCond
RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
And this .htaccess Code, shown below, allows at least Firefox Browsers, to
show FontAwesome Icons, regardless of the Settings required, mentioned above,
as you can see here in action, if you have a Firefox to test it:
http://opencart.li/shop/
http://www.opencart.li/shop/

Code: Select all

<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
found here:
https://github.com/cdnjs/cdnjs/issues/755
And the great thing, by use of this routine is, that one so will be able to make
an 'internally linked' FontAwesome Header link-line cookiefree !! :laugh:
It's therefore also another small step to get better GTMETRIX Results...

My Default Setting of the shop is http: //www.
(I disabled the .htaccess re-directing routine, to demonstrate the effects...)

Code: Select all

<link href="http://opencart.li/shop/catalog/view/javascript/font-awesome4/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
---
But I have no idea, if it works in other Browsers as well.
STILL, a REDIRECT Routine should be used in any case,
to make sure, that OC and it's many Scripts will function perfect,
by only be connected the 'configured' way.
Good Luck! ;)
Ernie

I'm rarely active at the OC Forum lately. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'100+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by v-v » Tue Jul 24, 2018 2:08 pm

Hi, thank you very much, it looks it works. :good:

v-v
Active Member

Posts

Joined
Wed Jun 16, 2010 10:09 pm
Who is online

Users browsing this forum: No registered users and 8 guests