Forum Moderators: open

Message Too Old, No Replies

Links in HTML

Links in HTML,

         

sderenzi

5:48 pm on Mar 24, 2004 (gmt 0)



This question is one that I've just thought up. It has to do with adding links in your HTML files. Basic enough though the question I am about to ask may have many different answers.

At the moment I'm using the entire URL when I create a link:

Example: [webmasterworld.com...]

Yet I am wondering should I simply use:

Example: www.webmasterworld.com

And also would writing it without the / make a difference? I have sometimes tried going to a site only to find I left out the ending / and that's why it wouldn't come up. I suppose it has to do with compatability issues. Also maybe writing:

Example: webmasterworld.com

would be a better approach. Will any have problems?

DrDoc

6:02 pm on Mar 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you talking about the link text or the href as such?

sderenzi

6:07 pm on Mar 24, 2004 (gmt 0)



I'm speaking of the URL itself.

Example:

<a href="www.webmasterworld.com">WebmasterWorld</a>

or would using

<a href="http://www.webmasterworld.com/">WebmasterWorld</a>

be better. Or I could use:

<a href="webmasterworld.com">WebmasterWorld</a>

As you can see there is a size difference and considering the many links I have it would make a difference to an extent. Which however it a better approach?

DrDoc

6:15 pm on Mar 24, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Then you have to use the full http:// thingy... Otherwise, a link such as <a href="foobar.com"> on example.net would cause the browser to look for a document called foobar.com... (http://www.example.net/foobar.com) and that's not what you want.

The trailing slash can be omitted.

nafmo

7:22 pm on Mar 24, 2004 (gmt 0)

10+ Year Member



"www.webmasterworld.com" is a reference to a resource (file) located in the same directory. To link to another server, you need to use a longer form.

You can omit the protocol if the link is to a page using the same protocol as yours, like this: <a href="//www.webmasterworld.com/">. Please notice, however, that there are a lot of buggy spiders out there that don't understand that kind of link, and generates bogus requests to a file called "//www.webmasterworld.com/" if you use them.

I use links on that form myself a lot, as it is less to type and it's fun to see who has read the specs and who has not when implementing the spider. It also gives the satisfaction of complaining to the bot owner (like the prototype version of the new msnbot from Microsoft, which had some problems in this area in the beginning).