Post by MichalVl » Tue Feb 19, 2019 5:34 pm

Hi,
I have an e-shop in Opencart 2.2.0.0. The data are uploaded on http://webian.akis.cz/kukin/brother.nah ... z/opencart. I also have a domain tiskarny.nahradko.cz. On our server (webian.akis.cz) I have the virtual host. So if someone writes http://tiskarny.nahradko.cz the data from webian are displayed. If I run my eshop from webian, everything is OK. But if I run e-shop from tiskarny.nahradko.cz, the font-awesome disappear. In console I get
http://webian.akis.cz/kukin/brother.nah ... f2?v=4.4.0. (Reason: missing header CORS 'Access-Control-Allow-Origin')
. So I edited .htacces in /opencart root and I added

Code: Select all

<IfModule mod_headers.c>
  <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css)$">
    Header set Access-Control-Allow-Origin "*"
  </FilesMatch>
</IfModule>
at the end of this file. But it didn't help. So where do I make a mistake?

Newbie

Posts

Joined
Mon Feb 18, 2019 9:47 pm

Post by IP_CAM » Wed Feb 20, 2019 12:06 am

Code: Select all

<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
Put that Code way up in the .htaccess file, before the:

Code: Select all

# SEO URL Settings
RewriteEngine On
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

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

Post by MichalVl » Wed Feb 20, 2019 3:16 am

IP_CAM wrote:
Wed Feb 20, 2019 12:06 am

Code: Select all

<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
Put that Code way up in the .htaccess file, before the:

Code: Select all

# SEO URL Settings
RewriteEngine On
Ernie
Thank you for your answer, but it didn't help.

Newbie

Posts

Joined
Mon Feb 18, 2019 9:47 pm

Post by OSWorX » Wed Feb 20, 2019 3:52 am

Maybe read something like this:
https://stackoverflow.com/questions/106 ... oesnt-work

And a 'bit' more for the interested:
https://www.html5rocks.com/en/tutorials/cors/

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by MichalVl » Wed Feb 20, 2019 4:36 am

OSWorX wrote:
Wed Feb 20, 2019 3:52 am
Maybe read something like this:
https://stackoverflow.com/questions/106 ... oesnt-work

And a 'bit' more for the interested:
https://www.html5rocks.com/en/tutorials/cors/
Thank you, but still no change. :(

Newbie

Posts

Joined
Mon Feb 18, 2019 9:47 pm

Post by felixrebollo » Fri Nov 20, 2020 5:21 pm

Hello
I have the same problem with my domain. If Iif I access from http://www.ojoalgato.es icons disappear. With the same error: Acces-Control-Allow-Origin...
It seems that you could solved at the end.
I will be so gratefull if you tell me how you did it.
Thank you

Newbie

Posts

Joined
Mon Jul 13, 2020 6:28 pm

Post by OSWorX » Fri Nov 20, 2020 6:10 pm

felixrebollo wrote:
Fri Nov 20, 2020 5:21 pm
Hello
I have the same problem with my domain. If Iif I access from http://www.ojoalgato.es icons disappear. With the same error: Acces-Control-Allow-Origin...
It seems that you could solved at the end.
I will be so gratefull if you tell me how you did it.
Thank you
First of all, why loading fonts from: felixrebollo.es
Fix that, and the Icons will be displayed.
Otherwise you have to allow loading fonts from that site (while not really recommended).

Second: fix the "samesite" cookie (enough posts here how to).

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by felixrebollo » Fri Nov 27, 2020 12:00 am

thanks OSWorX
The reason si that my domain is felixrebollo.es and when I decided to set up the online shop I used this domain and web hosting.
Then I thought to made a new "branding" called ojoalgato.es and I used an alias.
As you can see, I don't have much knowledge of programming and all that.
I'll try this of the cookies.
Thank you very much

Newbie

Posts

Joined
Mon Jul 13, 2020 6:28 pm

Post by felixrebollo » Fri Nov 27, 2020 1:57 am

I ve solved my problem.
I'm sorry
It was a mistake. I'd redirected my alias to ojoalgato.es/opencart2 instead to felixrebollo.es/opencart2/index.php
So the first direction didn't find the icons.
It was my fault.
Thank you for your interest OSWorX and sorry again.

Newbie

Posts

Joined
Mon Jul 13, 2020 6:28 pm

Post by OSWorX » Fri Nov 27, 2020 3:17 am

felixrebollo wrote:
Fri Nov 27, 2020 1:57 am
I ve solved my problem.
I'm sorry
It was a mistake. I'd redirected my alias to ojoalgato.es/opencart2 instead to felixrebollo.es/opencart2/index.php
So the first direction didn't find the icons.
It was my fault.
Thank you for your interest OSWorX and sorry again.
Glad to hear that it works now.

Everyone can make a mistake, but not everyone can say that it was his mistake.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 40 guests