Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
  •   Subject
  • Author
  • Posted on

Is it absolutely necessary to include "http://" in an A HREF hyperlink?
Would it be wise to remove this from one's Links page, just to save code?

Re: Does

Yeah Wrote:
> Is it absolutely necessary to include "http://" in an A HREF
> Would it be wise to remove this from one's Links page, just to save
> code?

It depends on where the link is going. If you are on the same URL then
you don't need it.

<a href="new.html"> this is within the same folder
on the same URL
<a href="images/picture.jpg"> this is within the same URL in a
<a href="../file.html"> this is within the same URL but in the folder

If the link is going to an outside URL or you have trouble with being
within a subfolder and accessing outside of it then yes you may need to
make an
absolute URL for it to follow.

Saving code really depends on what is on the
page (amount of links and
size) and SEO.

lunaticfringe's Profile:
this thread:


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- The #1 Newsgroup Service in the World! 120,000+
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Re: Does

Yeah wrote:
Quoted text here. Click to load it

In addition to all the other answers about relative links, you
should recognize that not all links use the hyper-text transfer
protocol (HTTP).  For example, a link to send E-mail to the
anti-spam address I used for this message would be

And a link to reach this newsgroup through your default news server
would be
   <a href="news:comp.infosystems.www.authoring.html">Authoring
Specifying a particular news server would be

Generally, when I refer to a page in my own Web site from another
page in the same site, I user relative links.  This facilitates
both testing and rehosting.  

For testing, links relative to my home page allow me to recreate my
Web site in a local directory on my PC.  This means that I can
navigate through my site without even connecting to the Internet.
Thus, I can check the appearance of a page and the integrity of
links without having to upload the pages to a Web server.  

If I want to rehost my Web site, none of my links require
changing.  I only have to change text that cites the domain.  Yes,
I now have a personal domain, which means that rehosting merely
requires pointing the domain to the new server and uploading the
files, even if my links used complete URLs.  However, if I were to
change the name of my domain, relative links mean that I would not
have to change them.  


David E. Ross

Concerned about someone (e.g., Pres. Bush) snooping
into your E-mail?  Use PGP.  
See my <

Re: Does

Quoted text here. Click to load it

Yes, and this is a great time saving if you later have to migrate to
a different server such as an IIS one where the default is
"default.htm" or "default.html". On at least one such server, I found
"index.htm" didn't work.
Quoted text here. Click to load it

No but there is one disadvantage on your end: if you have an image of
your site on your own computer, your browser won't know to serve up
the default file when it sees an HREF that ends in a "/". That makes
it harder to test all the links before uploading. (Mozilla shows a
file list in this situation.)

Fortunately, there's a way around that: the free Apache server
< is easy to install, and when
you have it running locally your browser connects to it
automatically. Since Apache is also the most popular server software
for "real" Web sites, this can be quite a good test of how your site
navigation will work when published.

Wed, 04 Jan 2006 21:55:08 -0500 from Rob McAninch <rob_13>:
Quoted text here. Click to load it

I doubt there would be even that, since the default file name would
most likely be held in RAM.

But we're in basic agreement: the performance penalty (if any) is
trivial, statistical "noise" compared to the time spent transmitting
the file.

Stan Brown, Oak Road Systems, Tompkins County, New York, USA
HTML 4.01 spec: /
validator: /
CSS 2.1 spec: /
validator: /
Why We Won't Help You:

Site Timeline