0

I've recently came across a problem with-in our website, We are using a sub-domain for the main domain & have came across a problem with our theme. Some light would be super helpful as i'm running out of options!

The problem is simply when i use our website by typing the following address - www.ecigone.co.uk

I receive no error's, But When i use the web address without the www. i receive artifact's instead of icon's. Especially in firefox.

I have tried a range of fixe's including re-direct's which have seemed to give no joy.

Alex
  • 11,115
  • 12
  • 51
  • 64
Steven
  • 31
  • 7
  • I get the error: `Font from origin 'http://...co.uk' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://...co.uk' is therefore not allowed access.` – showdev Mar 10 '15 at 16:47
  • Hi Showdev, Thank-you for replying so quick, Im quiet new to this site of development, Would it be possible to ask, what will need changing etc? – Steven Mar 10 '15 at 17:21
  • The short answer is: don't load files from "www" on your "non-www" domain. However, I advise that you choose to use either "www" or "non-www" and use an [`.htaccess`](http://httpd.apache.org/docs/2.4/howto/htaccess.html) file to redirect the one you didn't choose to the one you chose. This will also help to avoid "[duplicate content](http://moz.com/learn/seo/duplicate-content)" problems with search engines. [This post might be helpful](http://stackoverflow.com/questions/234723/generic-htaccess-redirect-www-to-non-www). – showdev Mar 10 '15 at 17:37
  • This is a very near duplicate of your issue: [webfont does not apear without www](http://stackoverflow.com/questions/25710015/webfont-does-not-apear-without-www) – showdev Mar 10 '15 at 17:50

1 Answers1

0

Thank's to Showdev for posting the link,

For anyone wondering & haven't found the answer, i used this code below.

RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

It Simply redirect's non www. to www, Hope this helps. Happy web developing!

Steven
  • 31
  • 7