Welcome Guest, Not a member yet? Register   Sign In
Images, CSS, JS disappear on any controller, but home page
#10

[eluser]cahva[/eluser]
Pickupman's example didnt work as the url was wrong if this is used from your localhost where the site starts from "mysite". So the correct would have been:
Code:
<link  href="/mysite/global_assets/templates/default/css/body.css" rel="stylesheet" type="text/css" />

..but ofcourse that will get you in trouble when you move your site to production server(without "mysite"). To get the goodies from both worlds, use base_url(or site_url) in your views and define your base_url in the config.php:
Code:
$config['base_url']    = "/mysite/";

And when in production server you can shorten that to "/". To make it automatic, you can do if else to check what server you are on(using $_SERVER['SERVER_NAME']) and define the base_url according to that.


Messages In This Thread
Images, CSS, JS disappear on any controller, but home page - by El Forum - 09-01-2010, 07:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB