RE: It's all relative
by "Tombs" <hwg(at)Kender.org>
|
| Date: |
Tue, 5 Oct 2004 16:54:16 -0500 |
| To: |
<hwg-techniques(at)hwg.org> |
| In-Reply-To: |
localhost |
| |
todo: View
Thread,
Original
|
|
David,
Here's what I do with this.
Using PHP, I have a settings page, where I store the absolute URL. This
page has some basic key facts:
Email addy sent from: URL
Email sent from name: NAME
Absolute URL of site: http://domain.ext
These are all stored in a settings array, so that I can call them at any
time.
Now, when I create a link, I use:
<?
include_once("settings.php");
global $settings;
echo '
<a href="'.$settings['url'].'/index.php">Home</a>';
?>
This will display a link of http://domain.ext/index.php.
Now, this may be a little advanced for some of you, but it is a way to keep
things relative and absolute at the same time.
My home server has a settings page that has the absolute URL of site as
http://localhost/CLIENTNAME while the uploaded version would actually have
their domain name.
Technically, that makes me an absolute, though I do have relative
tendencies.
J. Wheeler
Owner, Kender Internet Kompany
http://kender.org
-----Original Message-----
From: owner-hwg-techniques(at)hwg.org [mailto:owner-hwg-techniques(at)hwg.org] On
Behalf Of David Kendall
Sent: Monday, October 04, 2004 20:09
To: hwg-techniques(at)hwg.org
Subject: It's all relative
Another question,
Which is preferred, absolute or relative links for embedded URLs?
I can probably guess what your answer will be, but I'll go into some
detail here:
When I first started web designing (1994), I only had a dialup
connection that, for obvious reasons, I had to minimize my time on
(primarily because I was living with my parents at the time. :) )
Therefore, I got in the habit of, when I was offline designing with
Notepad, I'd make all my hyperlinks to internal documents (like
pictures, other pages within the site, etc.) relative, so that I don't
have to fire up the browser when I check it, I can just use my offline
copy that I have saved to my HD, a practice I have gotten in the
habit of doing and still use to this day.
I find many advantages to using relative links, even though I have a
cable modem now and no longer live with my parents. :) Firstly, I
always have a hard drive copy of all my clients pages, comes in
handy a lot of times. Also, I can compose changes at my leisure
and put them up all at once (if I change a picture that a URL points
to in the new version, having an absolute link would of course keep
pointing to the old picture, unless I upload the new picture, thereby
making the old page that's curently online look different ... ) It also
makes it easirer to diagnose if the problem is with the code or
something online.
However, I'm finding more and more pages are created with
absolute links now. (Granted, it's the old "if all your friends jumped
off a bridge ... " principle at work, more and more pages now are
having tables used for positioning too (a habit I'm trying to break
myself of)) There must be a reason for it. I have noticed one
advantage that I might use for it is, when using domain name
forwarding that's masked, relative links still show the true url in the
status bar on the bottom of the web browser when hovering,
absolute links wil probably fix that (and is the reason I'm thinking of
making the change.)
So, what's the general consensus, absolute or relative?
--
David Kendall - president / chief web designer
Home Pages Plus!
(204) 254-3649
david(at)homepagesplus.com
www.homepagesplus.com
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 9/28/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.771 / Virus Database: 518 - Release Date: 9/28/2004
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA
This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.