You are here:  » Why absolute pathnames ?


Why absolute pathnames ?

Submitted by keymaster on Fri, 2006-11-03 12:06 in

Hi David,

I have just moved my site to a dedicated server, but have not yet repointed over the domain names, so I am accessing the site through a temporary link involving the IP address and a subdirectory name.

Anyways, to make a long story short, all the relative pathnames in the site are working, but the absolute pathnames obviously aren't.

It seems most of the site is relative pathnames. Absolute pathnames are only used for the default.css, the search box, and the tapestry_buyURL (jump.php).

Any particular reason you decided to use absolute pathnames for those three things, but relative pathnames everywhere else?

Thanks.

Submitted by support on Fri, 2006-11-03 15:05

Hi,

Absolute path names are used in instances where the element may appear on any page of the site. A relative path is only used when it is always known exactly where on the site a link will be.

For example, if default.css were not an absolute path (it uses $config_baseHREF) you would need to have code to work out where you were and then generate an appropriate relative URL. Therefore, it's far more efficient to make it absolute.

All instances of absolute URLs use the $config_baseHREF variable, so if you move a site that is all you should need to change.

Cheers,
David.