Forum Moderators: open

Message Too Old, No Replies

Hard linking (absolute url) vs relational linking,

Which type of internal linking is better

         

davidlt

12:30 am on Dec 1, 2007 (gmt 0)

10+ Year Member



When linking between pages is it better to use the full url or just the directory and file name?

Ex:
is it better do use:
<a href=http://www.mysite.com/articles/seo-article.html>SEO Article</a>
or...
<a href="/articles/seo-article.html">SEO Article</a>

I have been having this discussion with my website designer and he says it doesn't matter. He says from an administration aspect, relational is better. I think this was discussed in the IMC training, but can't remember for sure.

Thanks,
Dave

phranque

5:59 am on Dec 1, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



i would agree with your website designer.
relative makes it much easier to create and test your content on a development or staging server.
seo-wise, it is the same thing.

davidlt

12:38 pm on Dec 1, 2007 (gmt 0)

10+ Year Member



Thanks Phranque

caveman

6:15 pm on Dec 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually, absolute linking is SEO best practice, for a variety of reasons.

There are some minor anti-spam implications, but the main reason is that absolute linking ensures that the SE bots crawl your site as easily as possible.

GoogleGuy commented on it years ago in this thread:
[webmasterworld.com...]

I would use a 301 redirect or rewrite so that your root page doesn't appear twice. For example, if you select http: //www.yourdomain.com/ as your root page, then if a spider tries to fetch
http: //yourdomain.com/ (without the www), your web server should do a permanent (301) redirect to your root page at http: //www.yourdomain.com/

So the high-order bits to bear in mind are
- make it as easy as possible for search engines and spiders; save calculation by giving absolute instead of relative links.
- be consistent. Make a decision on www vs. non-www and follow the same convention consistently for all the links on your site. Use permanent redirects to keep spiders fetching the correct page.

Those rules of thumb will serve you well no matter what with every search engine, not just with Google. Of course, the vast majority of the time a search engine will handle a situation correctly, but anything that you can do to reduce the chance of a problem is a good idea. If you don't see any problems with your existing site, I wouldn't bother going back and changing or rewriting links. But it's something good to bear in mind when making new sites, for example.

If you have a choice, which is most true in the initial development, it's better to go with absolute. Probably not worth going backwards though, and recoding an existing site, unless issues are apparent.

One thing you can do to help the SE's deal more effectively with relatively paths is to use the <base href=""> element in the head section of each page.

leadegroot

5:05 am on Dec 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I tend to use the full string so that I get a free backlink if my site is scraped
(No, I don't think they are actually valuable, it just seems good policy)
but I do tend to (PHP) stick it in a constant in an include and write the constant rather than hardcode the domain name across the site. This makes testing on the development server easier, domain moves (*sob*) easier and reusing the code easier.
(eg define ("SITENAME" 'www.mydomain.com'); ... <a href="<?php echo SITENAME;?>">link text</a> - untested)

phranque

9:21 am on Dec 2, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



i was assuming in my answer that you have static html files for your urls.