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 Attention is all you need 的代码运行
  • ¥15 一个服务器已经有一个系统了如果用usb再装一个系统,原来的系统会被覆盖掉吗
  • ¥15 使用esm_msa1_t12_100M_UR50S蛋白质语言模型进行零样本预测时,终端显示出了sequence handled的进度条,但是并不出结果就自动终止回到命令提示行了是怎么回事:
  • ¥15 前置放大电路与功率放大电路相连放大倍数出现问题
  • ¥30 关于<main>标签页面跳转的问题
  • ¥80 部署运行web自动化项目
  • ¥15 腾讯云如何建立同一个项目中物模型之间的联系
  • ¥30 VMware 云桌面水印如何添加
  • ¥15 用ns3仿真出5G核心网网元
  • ¥15 matlab答疑 关于海上风电的爬坡事件检测