Relative vs. Absolute Links

I have several questions regarding absolute and relative links.

A) When I post a newly designed website on my testing server I can’t use the links to navigate through it, if they are absolute. What is the best solution(s) for this?

B) What are the pros and cons to having absolute and relative links?

Thanks in advance,

Samuel :shifty:

[ot]Oooh ooh yes llamas!


if (!L33tSEO()) {
  return ((Llama) LlamaFarm.getInstance())++;
}

Yeah it’s a mangled version of that m0aRcoWbell Java code swirling about… just ordered the Tshirt : )[/ot]

cn i get som bklinks pls kthx, & moar llamas pls too k

SEO blither plus text-talk plus NPD equals gibberishification…

Logic, can I hire you as my SEO expert? I need some higher rankings FAST : )

I’ve spent five minutes reading an article on “SEO” …well I am now qualified as an “SEO” expert. :smiley: Hurrrah! [That is my impression of pretty much all “SEO” experts.]

I think rule one when it comes to SEO experts is that anyone who claims to be an SEO expert isn’t one.

Lawlz. Another client of mine went to a marketing and SEO company (formed by one of the former directors of a large telecom) where, on their own website, they have nonexistent tags and Javascript and multiple h1’s everywhere.

How’s anyone going to know who’s an expert and who claims to be an expert? Which is why my client’s mistake was getting an SEO expert in the first place. They may exist, somewhere. Nobody who thinks they need one knows where to find one.

No, his mistake was in hiring someone who claimed to be an SEO expert. If he’d hired someone who actually was an SEO expert then they wouldn’t have been given such inappropriate and completely wrong advice.

No, that was his mistake. He hired an SEO expert.

I have a friend/client with a Magento site and because his SEO guy said links had to be absolute, each and every link on his entire site is very, very long. It’s sad, because there are so many links (a link to every single product on every single page) that I’m pretty sure it is noticeable by dialup users. Not to mention, dealing with his HTML is extra maintenance.

Must be losing a lot of visitors as a result of that. Perhaps they should consider hiring an SEO expert to fix up their site. Obviously all the absolute links have to go as a first step. The extra time it takes for the domain lookups and the extra length of the page are far bigger SEO penalties than the minute extra benefit gained from the repetition of any keywords in the domain name (and with too many repetitions of the same keywords there’s also the keyword spamming penalty to consider).

The <base> element is only useful if it points to something other than the path to the current file. If it’s pointing to the location of the file you’re in, it’s unnecessary and redundant - then it’s safer to leave it out, so you don’t have to remember to change it later.

Absolute nonsense. The only thing I would do differently is that (for SEO purposes at least), the home link should just be “/” with no filename - this is so that search engines don’t end up indexing “/” and “/index.php”, with the risk that your link juice is split between the two.

All search engines care about is where the link takes them, they really don’t care whether it’s an absolute or relative link, just so long as it takes them to the right place.

As Max says, dumb rumours like this surround SEO and there are snake oil salesmen galore … but the truth is, there is no silver bullet.

When you come across a rumour like this, ask yourself “Would it make sense for Google to do this?”. Google is in the business of giving people the best websites to match the search query they put in. End of. They are not going to put arbitrary barriers in the way of that, like preferring absolute links. Would giving preference to sites with absolute links give more relevant search results? No. Is Google going to do that? No. Will using absolute linkshelp Google to spider and index your site? No. Is there any SEO benefit from using absolute links? I’ll let you answer that, and see if you’ve spotted the pattern :cool:

I would always use relative links. It is much less hassle, and it enables you to work locally and on a test server without having to change anything when you go ‘live’.:slight_smile:

use base tage for the absolute part of the address and than use relative path. relative path is good to use because if you need to change domain or directory you dont need to change the links , but the <base> tag.

I agree with r937 here, and if you use server-side languages it will work both locally and hosted when you use the server name in the href. In asp I use

<base href="http://<&#37;=request.serverVariables("SERVER_NAME")%>">

Which I don’t have to change when uploading

o rly? :slight_smile:

root relative links are way more flexible

especially when you combine them with the BASE tag

So here’s a related question: what’s the skinny on “root-relative” links:

/directory/page.html

Craig Grannell’s “The Essential Guide to CSS and HTML Web Design” recommends them, but I’ve read other articles that recommend against them.

Actually, I heard that only the home link needs to be absolute. The internal stuff can remain relative.

I heard this from an Australian guy who had his own SEO business. He seemed to feel it was quite important.

I agree though that most of these SEO rumours are dire.

I’ll sacrifice the chickens at the dark of the moon and get back to you. :lol:

No offense intended, but I just have this visceral hatred of all these SEO rumors. If you create a well-crafted, standards-compliant site with excellent content, there’s no need to propitiate the Google gods, your site will be fine without you losing your lunch over your bounce rate and all the other SEO sludge that comes around. You could be right that you might get some miniscule SEO benefit from absolute links, but I doubt those few extra hits are worth the time and effort you’ll need to expend on changing the links when you port your site to another domain, or tweak your site structure, or polish up your navigation, or…