Page 1 of 1

Access-Control-Allow-Origin

Posted: Tue Feb 19, 2019 5:34 pm
by MichalVl
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?

Re: Access-Control-Allow-Origin

Posted: Wed Feb 20, 2019 12:06 am
by IP_CAM

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

Re: Access-Control-Allow-Origin

Posted: Wed Feb 20, 2019 3:16 am
by MichalVl
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.

Re: Access-Control-Allow-Origin

Posted: Wed Feb 20, 2019 3:52 am
by OSWorX
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/

Re: Access-Control-Allow-Origin

Posted: Wed Feb 20, 2019 4:36 am
by MichalVl
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. :(