普通网友 2011-03-05 06:04
浏览 32
已采纳

Codeigniter自定义路由显示根站点背景图像?

Ok, so I have a project I'm working on: http://www.d2burke.com/exp/intern/

BaseURL is set to: '/exp/intern/'

.htaccess reroutes to /exp/intern/index.php

I have custom routes set up for

  1. http://www.d2burke.com/exp/intern/questions -- $route['apply'] = "internship/apply";

  2. http://www.d2burke.com/exp/intern/apply -- $route['questions'] = "internship/questions";

etc.

When you go to http://www.d2burke.com/exp/intern/internship/questions, all is well and the normal tan background shows up...

When you use one of the custom routes...you get the background image from my main site...? what is the world is going on?

  • 写回答

1条回答 默认 最新

  • dsmgcse8876 2011-03-05 06:24
    关注

    You seem to overwrite the background by loading an extra style sheet in the body content like so

    <link rel="stylesheet" href="../../css/style.css" />
    

    The browser interprets this as a relative path to your page path.

    In the internship/questions page, this relative page translate to http://www.d2burke.com/exp/css/style.css, which doesn't exists.

    The fix would be to use an absolute path like /css/style.css

    Note: It's pretty obvious if you use Firebug and check the Net tab

    EDIT: Alternatively, open Firebug, click the arrow in the Console tab and enable "Show Network Error". That way any 404 error will appear in your console and come up as an error (great debug feature)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料