www difference css doesnt load Topic is solved

Everything to do with Joomla! 3.x templates and templating.
Post Reply
User avatar
JurajB
Joomla! Explorer
Joomla! Explorer
Posts: 372
Joined: Fri Oct 02, 2015 3:28 pm

www difference css doesnt load

Post by JurajB » Thu Aug 13, 2020 5:24 am

Hi guys,
why my css doesnt load in https://www.gurutesting.tech/
and does load in https://gurutesting.tech/
What should I do? Any fix? Please describe.
Thanks.

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 9985
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: www difference css doesnt load

Post by sozzled » Thu Aug 13, 2020 5:26 am

What CSS "doesn't load"? What is the problem? Can you be more specific?
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

SharkyKZ
Joomla! Ace
Joomla! Ace
Posts: 1823
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: www difference css doesnt load

Post by SharkyKZ » Thu Aug 13, 2020 5:46 am

You are using an absolute URL to load the font. When on www.gurutesting.tech the font is still being loaded from gurutesting.tech.

Code: Select all

src: url("https://gurutesting.tech/templates/templatez/rexlia.woff");
But CORS policy does not allow that:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://gurutesting.tech/templates/temp ... exlia.woff. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
You can either add the missing header or use relative path.

User avatar
JurajB
Joomla! Explorer
Joomla! Explorer
Posts: 372
Joined: Fri Oct 02, 2015 3:28 pm

Re: www difference css doesnt load

Post by JurajB » Thu Aug 13, 2020 5:50 am

this works without www.

Code: Select all

@font-face {
  font-family: bebas;
  src: url("https://gurutesting.tech/templates/templatez/bebas.ttf");
}

@font-face {
  font-family: gtcp;
  src: url("https://gurutesting.tech/templates/templatez/rexlia.woff");
}
amd when I put www into links www.gurutesting.tech works but gurutesting.tech doesnt. Isnt this stupid? I know I can do declare both but is this normal?
I mean font family.
h3, menus, some text

User avatar
JurajB
Joomla! Explorer
Joomla! Explorer
Posts: 372
Joined: Fri Oct 02, 2015 3:28 pm

Re: www difference css doesnt load

Post by JurajB » Thu Aug 13, 2020 5:57 am

Code: Select all

@font-face {
  font-family: bebas;
  src: url("templates/templatez/bebas.ttf");
}

@font-face {
  font-family: gtcp;
  src: url("templates/templatez/relia.woff");
}
this doesnt work at all... I tried remove url but I think thats right. Why is this not working?

SharkyKZ
Joomla! Ace
Joomla! Ace
Posts: 1823
Joined: Fri Jul 05, 2013 10:35 am
Location: Parts Unknown

Re: www difference css doesnt load

Post by SharkyKZ » Thu Aug 13, 2020 6:02 am

It should be relative to the CSS file. If CSS file is in templates/templatez/css and font is in templates/templatez, use this:

Code: Select all

src: url("../rexlia.woff");

User avatar
JurajB
Joomla! Explorer
Joomla! Explorer
Posts: 372
Joined: Fri Oct 02, 2015 3:28 pm

Re: www difference css doesnt load

Post by JurajB » Thu Aug 13, 2020 6:12 am

OK I had to also edit stylesheet url in templatez index.php and so now it works.
So problem solved.
Thank you Sharky!


Post Reply

Return to “Templates for Joomla! 3.x”