Forum Moderators: open

Message Too Old, No Replies

When creating a link should you enter the full URL?

         

Mcadieux

6:16 am on Jan 27, 2005 (gmt 0)

10+ Year Member



Ok I have a site called www.widget.com Lets say my index is in Folder A, Folder A contains a folder called FolderB in folder B there is a file called widget.html when placing a link on my index to the file widget should I use "http://www.widget.com/folderb/widget.html" or should I just use folderb/widget.html? They both work, but when I use a spider simulator it seems to pick the short way up as a link to a diffrent site like www.folderb/widget.html. Now is there something wrong with the spider simulator I am using or is this how google sees it? If this is the way google sees it I am going to cry and cry and cry. Then cry some more since I tended to switch back and forth between the two. Wile making my site which now contains more than 300 pages.

larryhatch

7:03 am on Jan 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Mca: I can only tell you what I do, and it has worked for me:

WITHIN my site, meaning a link from one _page_ to another, I give the full URL.
That is, "http://mysite.net/targetpage.html"

I do likewise with outbound links to other sites.

I use short (relative?) links only for images, e.g. "graphics.gif"
That's only because its easier to debug pages before I send them up to the host.

Unless I'm wrong in this, a link from page A to page B (both on your site) is WASTED
with a relative URL because the Engines can't see the site, just some filename.
Maybe they have some algo to patch in the site for a full URL, but I wouldn't bank on that. - Larry

py9jmas

7:41 am on Jan 27, 2005 (gmt 0)

10+ Year Member



I use relative links throughout my sites. They are shorter, meaning smaller pages, and more importantly, less typing. I have never seen any legitimate spider have any issues with my links. One spider with a false User-agent string coming from a Chinease IP address choked on my links, probably those like href="../". This lead it to request a load of non-existant pages. (ie the pages existed, but not in the directory the spider was trying to find them in). I blocked that bot anyway on suspicions it was email address harvesting.

Coping with relative links is done for you in most programming languages. Spider authors have no excuses in getting it wrong.

TheDoctor

5:18 pm on Jan 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Realtive links also mean that you can create a development version of your website, identical in every respect to your operational one. Work on changes to a page, then copy it to your public website when you're happy, without having to retype your links.

[edited by: TheDoctor at 5:34 pm (utc) on Jan. 27, 2005]

Hanu

5:32 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Unless I'm wrong in this, a link from page A to page B (both on your site) is WASTED
with a relative URL because the Engines can't see the site, just some filename.

No, relative links work just fine with search engines. The problem with absolute links is that they cause a lot of duplication and editing overhead and that they might break when a page is moved. Nevertheless, some people swear by absolute links - I think it's to make it more difficult to hijack or hotlink their pages. These people recommend using search-and-replace tools to change absolute links.

My main motto is "Duplication Is Evil" so of course I recommend relative links. They are easier to maintain and reduce page sizes. In any case, relative links do not cause problems with the any of the major search engines.

Mcadieux

6:06 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Thanks guys I had nightmares last night about this. Must have been the spider simulator I used when I told it to spider the links it tryed spidering just folderb/widget.html instead of the full name. I was worried google would do the same thing. I am so glad I was wrong. You guys just added 10 years on my life thanks :)

WebGeek

10:51 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Just to throw something else out there.

You can combine realtive links with a <base href=""> tag.