473,769 Members | 5,471 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Does <A HREF hyperlink require "http://..."?

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?
Jan 4 '06
31 4867
Deciding to do something for the good of humanity, David Ross
<no****@nowhere .not> spouted in comp.infosystem s.www.authoring.html:
<a href="mail:no** **@nowhere.not" >Mail to me</a>


I think you mean mailto: not mail:

With all the standard caveats (i.e. it may not work) of course.

--
Mark Parnell
=============== =============== =============== ========
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/
Jan 4 '06 #11
On 04/01/2006 17:46, Yeah wrote:
Is it absolutely necessary to include "http://" in an A HREF hyperlink?
It depends what the destination is and the current base URI that any
relative URI might be resolved against.

If the link points to a site that uses a different scheme (https, ftp,
etc.) then an absolute URI is necessary. If the scheme is the same, then
you could use a network path reference. It's essentially an absolute URI
with the scheme removed.

From a document at

http://www.example.com/path/to/resource

the relative URI

//www.google.com/

would resolve to

http://www.google.com/
Would it be wise to remove this from one's Links page, just to save code?


Not really. It's only a few characters (five, in this case), so unless
there are thousands of such links, there's little return. If there were
thousands of links, time would be better spent recategorising them into
/much/ smaller lists.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jan 5 '06 #12
David Ross <no****@nowhere .not> writes:
For example, a link to send E-mail to the
anti-spam address I used for this message would be
<a href="mail:no** **@nowhere.not" >Mail to me</a>
<http://en.wikipedia.or g/wiki/.invalid>

Sigh.

FWIW, my from address is valid and auto-trashed, my reply-to address is
a free webmail service that employs its own spamfilters and beyond any
messages > 20KiB get auto-trashed as well. In 2005 I found exactly 0
(zero) occurances of spam in that Inbox.

My primary addresses are mostly harvested on Windows machines of social
and business relations, not on the Web or even Usenet, so I see little
reason to harvest unregistered TLDs myself to play silly games. Be so
kind to think about that as well.
Specifying a particular news server would be
Undocumented?
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.


Setting up a local web server shouldn't take more than 15 minutes for a
first time attempt even on win98. Besides the benefits of a real test
environment, you cannot seriously want to include the DirectoryIndex
file names in your relative URI references?

Jan 5 '06 #13
Eric Lindsay>:
In article <nm************ *@grumpy-fuzzball.mit.ed u>,
Bruce Lewis <br*****@yahoo. com> wrote:
Darin McGrew <mc****@stanfor dalumni.org> writes:

See also http://www.htmlhelp.com/faq/html/bas...l#relative-url
I want to amplify Darin's reference, because this page includes the
important example href="./" that is too often neglected.


I like that. So the idea is you could change all your references now to
an older style default file like href="index.htm " to href="./" [...] Are there any disadvantages? Extra lookup time vs having the path
including the actual file name used?


Technically there would be a brief lookup time (probably in the
millisecond range) for the server to consult the configuration and
then look for a default file to serve. As opposed to serving a
directly referenced file (which still requires some configuration
decisions from the server).

Nothing to worry about. Though be sure to configure the server's
search order for the correct default file.

--
Rob McAninch
http://rock13.com
Jan 5 '06 #14
Rob McAninch <ro****@excite. com> writes:
Technically there would be a brief lookup time (probably in the
millisecond range) for the server to consult the configuration and
then look for a default file to serve. As opposed to serving a
directly referenced file (which still requires some configuration
decisions from the server).


I think this is a pessimistic view of how it would work. Only the very
worst web server implementations on very old hardware would require a
whole millisecond to do it.

More likely enough information would be cached in memory to make the
delay immeasurable.
Jan 5 '06 #15
> > In article <nm************ *@grumpy-fuzzball.mit.ed u>,
Bruce Lewis <br*****@yahoo. com> wrote:
I want to amplify Darin's reference, because this page includes the
important example href="./" that is too often neglected.
Eric Lindsay:
I like that. So the idea is you could change all your references now to
an older style default file like href="index.htm " to href="./" [...]

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.ht m" or "default.ht ml". On at least one such server, I found
"index.htm" didn't work.
Are there any disadvantages? Extra lookup time vs having the path
including the actual file name used?


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
<http://httpd.apache.or g/download.cgi> 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
@excite.com>: Technically there would be a brief lookup time (probably in the
millisecond range) for the server to consult the configuration and
then look for a default file to serve. As opposed to serving a
directly referenced file (which still requires some configuration
decisions from the server).


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
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Jan 5 '06 #16
Stan Brown wrote:
In article <nm************ *@grumpy-fuzzball.mit.ed u>,
Bruce Lewis <br*****@yahoo. com> wrote:

I want to amplify Darin's reference, because this page includes the
important example href="./" that is too often neglected.


Eric Lindsay:
I like that. So the idea is you could change all your references now to
an older style default file like href="index.htm " to href="./" [...]

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.ht m" or "default.ht ml". On at least one such server, I found
"index.htm" didn't work.


With IIS you can set the default document for a directory or for a whole
site to anything you want. Or you can declare several, and IIS looks for
each one until it finds one that actually exists in the requested directory.
Jan 5 '06 #17
On Thu, 5 Jan 2006, Harlan Messinger wrote:
With IIS you can set the default document for a directory or for a
whole site to anything you want. Or you can declare several, and IIS
looks for each one until it finds one that actually exists in the
requested directory.


What a pity, then, that so few of its users seem to have the wit to
make good use of that! I lost count of the number of IIS servers
which perform an external redirect of requests for the default
document (I mean URLs which end in something like "hierarchy/") to
something like "default.as p". Pretty-much all of the rest seemed to
respond unhelpfully with "directory listing denied". Crabby lot (or
is it me...?).
Jan 5 '06 #18
Alan J. Flavell wrote:
On Thu, 5 Jan 2006, Harlan Messinger wrote:

With IIS you can set the default document for a directory or for a
whole site to anything you want. Or you can declare several, and IIS
looks for each one until it finds one that actually exists in the
requested directory.

What a pity, then, that so few of its users seem to have the wit to
make good use of that! I lost count of the number of IIS servers
which perform an external redirect of requests for the default
document (I mean URLs which end in something like "hierarchy/") to
something like "default.as p". Pretty-much all of the rest seemed to
respond unhelpfully with "directory listing denied". Crabby lot (or
is it me...?).


On the other hand, IIS sends a redirect response when a directory is
requested without a trailing slash:

Client: give me http://www.example.com/xyz/abc
IIS: ask for http://www.example.com/xyz/abc/ instead.

When the client makes the new request, THEN the server will send the
default file in the abc subdirectory. Do other web servers do this?
Jan 5 '06 #19

On Thu, 5 Jan 2006, Harlan Messinger wrote:
On the other hand, IIS sends a redirect response when a directory is requested
without a trailing slash:

Client: give me http://www.example.com/xyz/abc
IIS: ask for http://www.example.com/xyz/abc/ instead.
I can't recall a web server which doesn't do that, by default.

Pedants (such as DJ Delorie, who at one time had an explicit
demonstration on his web site in order to "make a point") have
to go to extra trouble if they want to disable that behaviour.

Apache is perfectly capable of being configured to return two
different valid resources in response to the two distinct URLs
http://www.example.com/xyz/abc and http://www.example.com/xyz/abc/ ,
but you have to work at it, it isn't something that happens by
accident. The default behaviour is the one that you (and most other
people) expect.
When the client makes the new request, THEN the server will send the
default file in the abc subdirectory.


Maybe. It depends. I've seen IIS servers which then issue yet
another redirection to default.asp

In fact I recall a Microsoft server which, when asked for the
canonical URL (ending in "hierarchy/"), issued four successive
redirections before it finally got around to returning some content
with a 200 OK status. The final URL was distinctly unmemorable (and
different every time).
Jan 5 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1898
by: Uwe Mayer | last post by:
Hi, when extending a build in class, what does the constructor __init__(...) have to return? and how does the constructor call its base-class construtor? (or is this done automatically?) I want to derive from "file" to create a class that reads record from a binary file:
24
4495
by: sinister | last post by:
After doing a websearch, it appears that it's OK to omit the "http:" to form a relative URL. Are there any pitfalls to this? For example, if there is a page http://www.domain1.com/page1.html with a link to http://www.domain2.com/page2.html you can abbreviate the second link as //www.domain2.com/page2.html
11
14654
by: whisher | last post by:
Hi. Sorry to disturb you but I can't figure out its use in this snippet (Found in many scripts about Ajax) function loadpage(page_request, containerid) { if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)) { document.getElementById(containerid).innerHTML=page_request.responseText;
1
2377
by: silverachilles | last post by:
Hello, I have php code which takes an rss feed and outputs it on a page of my website. For each item it shows the link, title and description. My problem is the description element contains a lot of information (some links and other stuff) and I want to extract one of the links out of this information, so that on my webpage I am shown the link, title and the link I want out of the description, for every item. How would I achieve this? If...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10047
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.