Welcome Guest, Not a member yet? Register   Sign In
Getting the paths correct
#3

[eluser]JoostV[/eluser]
Rewritten urls tend to confuse browsers. A url like www.domain.com/foo/bar tricks the browser into thinking it is in directory foo/bar/. This means you cannot use relative urls as you would on a static site.

I always use absolute paths:
Code:
<link rel='stylesheet' type='text/css' media='all' href='<?php echo $this->config-base_url; ?>style.css' />

Alternatively, you can set a base href in your <head> section:
Code:
<base href="<?php echo $this->config-base_url; ?>" />

Url in css files are always relative to the the css file itself.


Messages In This Thread
Getting the paths correct - by El Forum - 11-27-2008, 11:27 PM
Getting the paths correct - by El Forum - 11-28-2008, 03:31 AM
Getting the paths correct - by El Forum - 11-28-2008, 03:35 AM
Getting the paths correct - by El Forum - 11-28-2008, 08:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB