-1

I have created many WordPress sites and there is something I was never able to fix.

When you have two domains for the same website (such as www.example.com and www.example.fr) only one shows correctly and the alternative doesn't show it's images.

I guess this is a common problem that might happen to a lot of you. Any idea to help me fix it ?

ham-sandwich
  • 3,975
  • 10
  • 34
  • 46
Ariel
  • 549
  • 1
  • 5
  • 13

1 Answers1

0

First, check that both WordPress Address (URL) and Site Address (URL) are set properly in

wp-admin/ >> Settings >> General

If that is not the case, see the error messages in the console:

(index):1 Font from origin 'http://draidel.com' 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://draidel.com.ar' is therefore not allowed access.

You can resolve this by adding the following to you .htaccess

Header add Access-Control-Allow-Origin "draidel.com"

You may need to change the permissions of .htaccess as WordPress loves to change it randomly.

ham-sandwich
  • 3,975
  • 10
  • 34
  • 46
  • both WordPress Address (URL) and Site Address (URL) are both set to "http://draidel.com", if I switch it for .com.ar then its .com the one that doesn't show properly and I added that line to my .htaccess file but I still see the same problem :( – Ariel Jan 10 '16 at 21:32
  • Sorry, I added the wrong domain. Change that in `Header add Access-Control-Allow-Origin "draidel.com"`... also make sure to clear your cache or view the site in incognito. – ham-sandwich Jan 10 '16 at 21:47
  • it seems it only works with Header add Access-Control-Allow-Origin "*" which is not very clean.. but doest the trick – Ariel Jan 10 '16 at 22:14