[SOLVED] Local Fonts in PHPRunner 10.8 (adding .htaccess) ? |
7/16/2022 11:42:54 PM |
PHPRunner General questions | |
![]() The local fonts work perfectly in new PHPRunner 10.8 but only locally. Access to font at 'https://MYDOMAIN/fonts/BarCode_mrvcode39extma.ttf'>https://MYDOMAIN/fonts/BarCode_mrvcode39extma.ttf'>https://MYDOMAIN/fonts/BarCode_mrvcode39extma.ttf'>https://MYDOMAIN/fonts/BarCode_mrvcode39extma.ttf' (redirected from 'https://MYDOMAIN/fonts/BarCode_mrvcode39extma.ttf'>https://MYDOMAIN/fonts/BarCode_mrvcode39extma.ttf'>https://MYDOMAIN/fonts/BarCode_mrvcode39extma.ttf'>https://MYDOMAIN/fonts/BarCode_mrvcode39extma.ttf') from origin 'https://MYDOMAIN' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Found on internet that we can solve this by adding .htaccess file and adding 3 lines of code in there. Can we add .htaccess to PHPRunner projects? Or is there a workaround for this local fonts problem on webservers? Here is the link to the .htaccess solution: |
|
![]() |
Davor Geci authorDevClub member 7/27/2022 |
How to use local fonts on a webserver that blocks with CORS policy? |
![]() |
Sergey Kornilov admin 7/27/2022 |
I think you need to post the exact error message. Not clear how and why https://MYDOMAIN/fonts/BarCode_mrvcode39extma.ttf'>https://MYDOMAIN/fonts/BarCode_mrvcode39extma.ttf would be redirected to https://MYDOMAIN/fonts/BarCode_mrvcode39extma.ttf'>https://MYDOMAIN/fonts/BarCode_mrvcode39extma.ttf |
![]() |
Davor Geci authorDevClub member 7/27/2022 |
Here are the 2 errors from the console that I'm getting when loading the page with local font: First: Access to font at 'https://winpis.com/fonts/BarCode_mrvcode39extma.ttf' (redirected from 'https://www.winpis.com/fonts/BarCode_mrvcode39extma.ttf'>https://www.winpis.com/fonts/BarCode_mrvcode39extma.ttf') from origin 'https://www.winpis.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. And the second error: winpis.com/fonts/BarCode_mrvcode39extma.ttf:1 Failed to load resource: net::ERR_FAILED And here is from the Issues: Ensure CORS response header values are valid I have uploaded the project to a demo account that is bound to my email davor.geci gmail.com but with some errors about a database not created while uploading the project. |
![]() |
Davor Geci authorDevClub member 7/27/2022 |
Not sure, but I think that the code generated is wrong. 'https://winpis.com/hewams/fonts/BarCode_mrvcode39extma.ttf' and not at the location that the error is showing |
![]() |
Sergey Kornilov admin 7/27/2022 |
I can see two issues here and neither one is PHPRunner related.
|
![]() |
Davor Geci authorDevClub member 7/30/2022 |
Thanks for your reply admin. The problem was solved by creating a folder "fonts" in the root of my domain and copying the fonts from the app "fonts" folder to the domain root "fonts" folder. |