Absolute vs. Relative Links – Which is Better?
There are two ways to link to a file/page/location in HTML, either by using absolute or relative paths:
An absolute path defines a location by including the protocol, the server/domain, the directory (if needed) and the name of the document itself. Below is an example of an absolute path:
<a href="http://www.search-this.com/page.html">
With a relative path, you skip the protocol and server/domain name and go directly to the page name, like so:
<a href="/page.html">
So which is better?
Well you’ll get different responses depending on who you ask. Many people will tell you that relative paths are better but I’m not one of them! I always recommend absolute paths and here’s why:
At one point GoogleGuy, an employee of Google, who helps fight crime — or at least helps webmasters — said, and I quote, “absolute links have less potential for getting messed up [when Google indexes your page]. Even though it shouldn’t make a difference, I recommend absolute links.”
OK, sure, maybe just because GoogleGuy said so is not a good enough reason. I agree. So here is — we live in a time where people scrape your content and place it on their own site. If you’re going to get scraped you may as well get a link back to your site, right? That’s only going to happen with an absolute path!
And it’s not just scrapers. There are other legitimate ways to have your content show up on other sites; like RSS and web-services. I think in todays web, it’s no longer just personal preference; absolute paths are the way to go.

January 17th, 2008 at 7:12 am
I think you’re right. We are using relative at the moment and it will be a big job to move over to absolute. I’ve seen instances where Google has got links wrong. Google cache doesn’t seem to work too well either with relative links.
January 18th, 2008 at 10:39 am
I don’t agree with this at all for a lot of reasons. Trying to make your site get in-links from scrapers is a null point and ridiculous.
You want to use relative paths as much as possible, they are not only going to take the file size of your site down but when working from a development point of view it is mandatory to use relative links.
The biggest reasons for this is most developers use a “development subdomain” that you will be working on the project until it goes live. You don’t want to go back and change all of them to the new domain if you are using absolute.
Using relative paths is a just good practice (almost a standard) in web design.
January 18th, 2008 at 11:21 am
@Dustin – using a config file is pretty easy to do with the correct domain to use on your live domain and your stage sub-domain.
January 18th, 2008 at 2:39 pm
@Dustin – “Trying to make your site get in-links from scrapers is a null point and ridiculous.”
Not when your site is scrapped by a dozen sites like this one is…
“You want to use relative paths as much as possible, they are not only going to take the file size of your site down”
file size, talk about a null point…
And Jack is dead on, you would just use a config file to change from development to production. It’s real simple. It’s what WordPress does, and it’s what you should do too.
So in the end relative pathing gains you nothing, save a few bytes.
January 20th, 2008 at 8:54 am
Well recently it was revealed that “GoogleGuy” is none other than Matt Cutts.
Hence, obviously what he has said, is definitely correct.
January 21st, 2008 at 3:20 pm
One more reason to enter absolute path:
You will write more time your domain name (considering it makes certainly part of your SEO strategy), I totally agree with what you said: Absolute path is the way to do it
February 6th, 2008 at 3:38 pm
[...] Absolute vs. Relative Links – Which is Better? (Search-This) — “Well you’ll get different responses depending on who you ask. Many people will tell you that relative paths are better but I’m not one of them! I always recommend absolute paths and here’s why…” [...]
February 15th, 2008 at 1:13 am
There’s no point in saving a few bytes when using relative links…except if each page of your website contains thousands of links. However, as @Dustin says, relative links is a good practice.
We can’t deny the fact that in-links contribute to page ranking.
So, the solution is simple. You just have to use both of them, wherever necessary.
February 18th, 2008 at 12:50 pm
The only pain with absolute links, which I do prefer for too many reasons to list (and only a few for “not”) is when your internal or external engine points you to the “www” path (or not) and when you get your search results you get relative links.
If your absolute links take you from there to a “www” path (or not) and you have login credentials on that folder, you’ll be prompted for login credentials everytime you go from “www” to just “http” and vice versa, so there’s the chance for one addtl. login prompt along an absolute path where htaccess exists in the folder….
March 13th, 2008 at 11:23 am
Absolute links are better in my opinion and you could say yeh but what happens moving from dev to test servers with different base domains… however if you use a content mgt system then this can be managed quite easily.
If the end product in the HTML is an absolute link, then that’s the best for me, even if what’s stored in the CMS is a relative link making it best practice.
July 5th, 2008 at 6:05 pm
Wow…. I never thought of it with regards to scraping, but this is awesome! I will be writing about this very soon on my blog in my internal link building series.
October 22nd, 2008 at 6:35 am
[...] this one is a tough question. There is numerous number of posts concerning this subject. I decided to put all that together in a single [...]
May 22nd, 2009 at 11:04 am
@Jack – A configuration file? Meaning for every link you’d need server-side code prefacing every link to fill in the domain? No thanks.
@Golgotha – And Google (well, Matt Cutts) has already stated that for some sites that do scrape, getting links from them will result in a penalty.
I also disagree that file size is a “null point.” If all you’re after is rankings, usability be damned, then go right ahead. The rest of us have to balance many factors, file size being a small factor, but development server URLs are the main benefit of relative URLs.
@Adi – Recall that Matt Cutts does not speak from an SEO-only perspective. He, as with all engineers at Google, is focused on making the web more usable for humans, not for SEOs.
August 19th, 2009 at 9:46 am
My dedicated server host told me my server halted yeserday due to too many internal full URL links on the home page. The problem was “too many connections.” I was using the full path to bring up about 20 clickable thumbnail images which brought people to internal articles. He said that each of these created a new instance, or new connection. He said that relative path links did not create this problem.
The crash happened twice, and after I changed the links, it was fine.
Anyone here ever hear of anything like this?
September 28th, 2009 at 8:46 pm
You will write more time your domain name (considering it makes certainly part of your SEO strategy), I totally agree with what you said: Absolute path is the way to do it.We can’t deny the fact that in-links contribute to page ranking.
So, the solution is simple. You just have to use both of them, wherever necessary.
September 28th, 2009 at 8:48 pm
Absolute links are better in my opinion and you could say yeh but what happens moving from dev to test servers with different base domains… however if you use a content mgt system then this can be managed quite easily.