开发者

Codeigniter Custom Routing showing root site background image?

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. 开发者_如何学JAVAhttp://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?


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)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜