View Full Version : Absolute Linking Within Site


Gymfan15
05-28-2006, 06:06 PM
My website has a bunch of subdirectories, and I've found that in each one I have to upload a separate commonly used file (i.e. stylesheet, header, include, background and favicon) because they're linked using /images/header.jpg or a similar method.

I was wondering...is there any definite advantage to using that kind of linking? Because I know that if I use absolute linking (i.e. www.spareoom.net/images/header.jpg) then I'll only need one image for the whole site.

I know that if one were to move the site to a different domain, having more directory-aimed links would help, but I'm not planning on moving.

Anyway...I was wondering. It would sure save me a lot of hassle if I just had one stylesheet; one header; etc., but I want to make sure I'm not doing something unwise.

Chris
05-28-2006, 06:15 PM
I always use just one of each item, and just use the entire link to retrieve it.

Using absolute linking means that there is less chance of you forgetting to upload that file into each subdirectory, and when it needs updating you only have to update it once, rather than in each different subdirectory :D

pb&j
05-28-2006, 07:42 PM
you can have one "main" directory to hold the common stuff and still use "relative" linking. just use these...

../

or

./

to reach the different levels in your directory structure.

as you surmised, the main problem would occur if you moved your site, but then again, if you have your own domain, that wont be a problem either considering the domain name would be the same on a different host since that name would move with you.

pretty much comes down to personal preference.

jessimo093
05-29-2006, 03:47 AM
I myself use absolute linking because I find it easier but I agree with pb&j, it's just a matter of personal preference.
But just to name an advantage, no matter which directory you're working with, you'll always know where the thing is you're looking for is. If that made any sense...