iYunCMS(帝云CMS)-免费开源可商用的PHP万能建站程序
帝云CMS建站过程中有时会发现网站后台或者前端出现图标无法显示的问题,图标显示为方框状态了,如下图所示:
审查元素可以看到如下的报错信息
这是因为跨域访问造成的,也就是访问的域名并不是网站填写的主域名。
网站设置中填写的是域名A,但使用域名B访问,就会存在跨域问题。
一、apache环境
方法1:
直接在网站根目录 .htaccess文件 中添加如下代码即可:
<IfModule mod_headers.c>
# Make sure proxies don’t deliver the wrong contentHeader append Vary User-Agent env=!dont-vary
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
方法2:
在httpd.conf 尾部加上
LoadModule headers_module modules/mod_headers.so
<IfModule mod_headers.c>
# Make sure proxies don’t deliver the wrong contentHeader append Vary User-Agent env=!dont-vary
<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
在nginx.conf 内部加上
location ~* \.(eot|ttf|woff|svg|otf|woff2)$ {
add_header Access-Control-Allow-Origin *;
}
如果是宝塔面版,在网站配置文件中添加即可,如下图所示:
1、如果用了CDN的话,需要配置HTTP头
entOS 中部署JasperReport时出错:
net.sf.jasperreports.engine.util.JRFontNotFoundException: Font '宋体' is not available to the JVM. See the Javadoc for more details.
原因:操作系统默认语言是英文版的。修改为中文并拷贝windows的字体到linux系统中并应用,重启应用服务器即可。
1、把需要用到的字体(可以直接拷贝windows系统的C:\WINDOWS\Fonts 下的相关字体)拷贝当前项目的classpath下,一般为classes目录下
2、在classpath里添加 jasperreports.properties 属性文件
文件内容为:net.sf.jasperreports.awt.ignore.missing.font=true
3、重启应用服务器
如若转载,请注明出处:开源字节 https://sourcebyte.vip/article/303.html
*请认真填写需求信息,我们会在24小时内与您取得联系。