Home › Forums › WoodMart support forum › Missing icons/fonts using WPML with different domains
Missing icons/fonts using WPML with different domains
- This topic has 5 replies, 2 voices, and was last updated 1 month, 3 weeks ago by Luke Nielsen.
-
AuthorPosts
-
October 14, 2024 at 9:42 am #604746
davidParticipantMy site is installed under example.de. I am using WPML to translate my site into English. For the english content I am using a .com domain.
I have created a test page. When I translate it and visit the english version, some icons are missing and I get the following errors in the console:
Quellübergreifende (Cross-Origin) Anfrage blockiert: Die Gleiche-Quelle-Regel verbietet das Lesen der externen Ressource auf https://www.example.de/wp-content/themes/woodmart/fonts/woodmart-font-1-400.woff2?v=7.6.0. (Grund: CORS-Kopfzeile ‘Access-Control-Allow-Origin’ fehlt). Statuscode: 200.
downloadable font: download failed (font-family: “woodmart-font” style:normal weight:400 stretch:100 src index:0): bad URI or cross-site access not allowed source: https://www.example.de/wp-content/themes/woodmart/fonts/woodmart-font-1-400.woff2?v=7.6.0
October 14, 2024 at 2:39 pm #604870
Luke NielsenKeymasterHello,
Is there any chance that you could give me access to the dashboard area so I can have a look at the settings on your website, please?
Kind Regards
October 18, 2024 at 11:40 am #606009
davidParticipantHi Luke,
sorry for my late reply. I did not get any notification.
I could fix the issue with the following htaccess code:
<ifmodule mod_headers.c> Header set Access-Control-Allow-Origin "https://www.example.com" </ifmodule>
Do you see any problems with this solution?
And for some reason, when I click on the language switcher to see the translated page, there is an url parameter like “?xdomain_data=” appended. Is that the intention? And can I deactivate it?
Thank you and kind regards,
DavidOctober 18, 2024 at 12:39 pm #606032
Luke NielsenKeymasterHello,
1. If that solution works, then it’s okay.
2. Did you check how it works on the default theme?
Thank you for your time.
Kind Regards
October 18, 2024 at 1:25 pm #606063
davidParticipantSorry, I thought the “x” from “xdomain_data” came from “xtemos” 😉
But it comes from WPML and seems to be neccessary when using different domains.
And if it helps anyone, I changed the htaccess code to:
<IfModule mod_headers.c> SetEnvIf Origin "^http(s)?://(.+\.)?(example\.de|example\.com)$" origin_is=$0 Header always set Access-Control-Allow-Origin %{origin_is}e env=origin_is </IfModule>
October 18, 2024 at 3:36 pm #606098
Luke NielsenKeymasterHello,
Great! In this case, the topic can be closed?
Thank you for your time and patience.
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register