drgdn82648 2013-11-01 13:31
浏览 164
已采纳

加载字体文件CodeIgniter时出错403错误

Hello I am new to codeigniter. I am using the external font file for my site through css. Here is my css code:

@font-face {
font-family: 'ElegantIcons';
src:url('http://localhost/findacare/font/ElegantIcons.eot'),
    url('http://localhost/findacare/font/ElegantIcons.eot?#iefix') format('embedded-opentype'),
    url('http://localhost/findacare/font/ElegantIcons.woff') format('woff'),
    url('http://localhost/findacare/font/ElegantIcons.svg#ElegantIcons') format('svg'),
    url('http://localhost/findacare/font/ElegantIcons.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

But i'm getting the following error file when i load the file

GET http://localhost/findacare/font/ElegantIcons.woff 404 (Not Found) manage_profile:1
GET http://localhost/findacare/font/ElegantIcons.svg 404 (Not Found) /findacare/font/ElegantIcons.svg#ElegantIcons:1
GET http://localhost/findacare/font/ElegantIcons.ttf 404 (Not Found) /findacare/font/ElegantIcons.ttf:1

And my file structure is:

findacare-
          -application
          -css
          -font
          -images

I checked many times even by giving absolute path. Could any one please help me.

  • 写回答

3条回答 默认 最新

  • dtlc84438 2013-11-01 13:56
    关注

    If you look in your .htaccess file you most likely have a line of code that looks something like this:

    RewriteCond $1 !^(index\.php|robots\.txt|css/|js/|images/)

    This is a white list of folders/files that won't be passed through your applications index.php. All other urls will be passed into the application.

    Because your font folder is in the webroot, you need to add this folder to the whitelist so that it can be accessed by your css rules.

    RewriteCond $1 !^(index\.php|robots\.txt|css/|js/|images/|font/)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 请问各位,如何在Jetson nano主控板的Ubuntu系统中安装PyQt5
  • ¥15 MAC安装佳能LBP2900驱动的网盘提取码
  • ¥400 微信停车小程序谁懂的来
  • ¥15 ATAC测序到底用什么peak文件做Diffbind差异分析
  • ¥15 安装ubantu过程中第一个vfat 文件挂载失败
  • ¥20 GZ::CTF如何兼容一些靶机?
  • ¥15 etcd集群部署问题
  • ¥20 谁可以帮我一下问一下各位
  • ¥15 为何重叠加权后love图的SMD与svyCreateTableOne函数绘制基线表的不一致
  • ¥150 求 《小魔指》街机游戏机整合模拟软件