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

加载字体文件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 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 luckysheet
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱