Ann Smarty

SEO & Internal Interlinking: Relative vs Absolute URLs

June 5th, 2008 by Ann Smarty | 33 Comments

To some SEO questions there are no definitive answers unfortunately. Using absolute or relative URLs to interlink related site subpages is just such a question.

Many SEOs will tell you there is no difference and the main thing is to be consistent with your choice. Others (they seem to be in majority) support absolute URLs, while web developers and designers consider it stupid and irrational.

I did my best to make up the list of all possible pros and cons and leave that for you to decide:

Absolute URLs for internal interlinking:

Example: < a href="http://www.searchenginejournal.com/about-us/4070">About SEJ < /a>

  • are better when handling canonicalization issues;
  • are safer when talking about site hijacking;
  • are safer when switching to a new CMS;
  • will save you in cases when your content is stolen and the thief does not take time changing the internal references;
  • are a better choice if your content is distributed via email (you do want your readers to click the internal links and actually get to the page, don’t you?);
  • might be easier for search engines to follow as they resolve all relative URLs to absolute ones before following them.
  • Relative URLs for internal interlinking:

    (First, a short definition of a relative URL)

    URL whose location is specified relative to the address of the base document in which the URL resides. It provides a shorthand way to refer to files or resources that use the same protocol, domain name, or directory path as the current document. (source)

    Example: < a href="/about-us/4070">About SEJ < /a>

  • make it easy to move from one domain to another one;
  • make the code shorter which might decrease a page’s download time.
  • Please share your opinion:

    Also please add your pros/cons in the comments.

    Vote for this post : 16 Vote down Vote up or Buzz it at Yahoo :


    Comments

    33 responses so far ↓

    • Mercy on Jun 4, 2008 at 11:29 pm

      If you would like your images to show in RSS you need to have absolute URLs rather than relative URLs. I personally prefer absolute URLs.

    • Raghavan on Jun 5, 2008 at 12:46 am

      how about tag and using relative URL?

    • Web Agency Chieti on Jun 5, 2008 at 3:33 am

      I don’t agree with you. There no absolute difference in term of seoing using an absolute or relative url.
      Simply the search engine get it from the remote-host param that every web server release during the navigation.
      In term of design, instead, the big difference is that testing a web site with relative url is easier since you can do it locally.

      Apart from this, Ann I’m pretty curios to understand in whych way an absolute url can prevent material theft. Could you elaborate this?

      Andrea

    • Ann Smarty on Jun 5, 2008 at 3:46 am

      Andrea,

      “There no absolute difference in term of seoing using an absolute or relative url.”

      And that’s why I used “might” in the sentence, I am not insisting on that - just outing other people’s opinion.

      “testing a web site with relative url is easier since you can do it locally”

      That’s an excellent point, thank you! I wonder why it didn’t occur to me.

      “in which way an absolute url can prevent material theft”

      I guess you are referring to this point: “when your content is stolen …” - it often happens that the thief forgets to remove in-text post interlinking - so when using absolute URL you get minor deep backlinks from the thief’s site.

      Thank you for the great comment and valuable additions!

    • DG on Jun 5, 2008 at 3:51 am

      I don’t think there’s any difference in terms of SEO, and it’s better to use Absolute URLs over Relative. If you’re not planning to change your site structure or domain.

    • Raghavan on Jun 5, 2008 at 4:26 am

      How about using the base tag and using relative URL?

    • Stephen T on Jun 5, 2008 at 6:31 am

      Yes the <base> tag is another thing to consider. This is where you use a tag in the head of the page to say where all relative URLs start. For example putting

      <base url=”http://www.mysite.com/content/”>

      in the <head> tag and then using a relative URL in an anchor

      <a href=”june/2008/mypage.html”>a page</a>

      would resolve to the URL

      http://www.mysite.com/content/june/2008/mypage.html

      The use of the <base> tag is popular when using mod_rewrite to create search-friend URLs. For example the URL above could actually be a re-write to

      http://www.mysite.com/content.php?pageId=12

      The advantage of using the <base> tag here is that you can use an arbitrary directory structure determined by your SE-friendly URL structrue but still allow relative URLs to work. The question is, does this make any difference in terms of SEO? As far as I know, the major spiders seem to respect the <base> tag but if they didn’t then URLs would not resolve properly.

    • Raghavan on Jun 5, 2008 at 6:55 am

      Stephen,

      Thanks for sharing. My question is also the same that using this tag does it make any difference in terms of SEO?

    • Web Agency Chieti on Jun 5, 2008 at 7:05 am

      Ann

      “it often happens that the thief forgets to remove in-text post interlinking”

      He sounds like a stupid thief :)

    • Web Agency Chieti on Jun 5, 2008 at 7:08 am

      Stephen,

      you mean a tag for every url, that will be parsed by a server-side script language, or something different?
      I don’t use php, so it’s just partially clear what you have said.

    • Raghavan on Jun 5, 2008 at 7:23 am

      Its an HTML tag and used before the end of head tag. You define the base tag initially and your relative URLs will be treated as absolute.

    • Ann Smarty on Jun 5, 2008 at 7:30 am

      Andrea,

      lol… you might be surprised to hear how often that actually happens :)

    • Web Agency Chieti on Jun 5, 2008 at 8:11 am

      Ann

      sometimes I continue to amaze myself for centain things :D

      @Raghavan,

      could you make me an example, please? This is new for me

    • Wil Reynolds on Jun 5, 2008 at 8:56 am

      Ann, I had someone copy everything including the web tracking code, one day the clients traffic was up 300x - sometimes you would be absolutely amazed, agreed.

    • Richard Burckhardt on Jun 5, 2008 at 9:28 am

      I’m a firm believer in using absolute URLs whenever possible and blogged about this myself a few months ago in a post titled “Absolute URLs? Absolutely!” that you can get to by clicking on my name above.

      Absolute URLs can make life so much easier when dealing with https pages and even scrapers. For instance, if your content gets scraped, those absolute URLs get scraped with it so you at least get links back to your site.

      I have even caught careless content thieves who tried to post my articles under their own names when they *thought* they had removed URLs from the articles but left the “a href=” code in by mistake. WordPress and Google Alerts notify me of new links so that I can pounce on them.

      What can I say? I love absolute links. Unless there is a very good reason to use relative links, they are mandatory for me.

    • Raghavan on Jun 5, 2008 at 9:43 am

      Andrea,

      I’m not able to post comments with tags there seems to be some filter. Just Google it and you can get it else skype: raghavan8in I can help you out

    • David on Jun 5, 2008 at 12:34 pm

      I always use the full URL. I don’t think the old arguments for relative linking are that important anymore.

    • Catfish SEO on Jun 5, 2008 at 1:07 pm

      Absolute URLs are safer in terms of elimiating potential duplicate content issues. However, for a lot of sites its impossible to code using absolute URLs because that would break their staging environment. We have configured our CMS system to use relative URLs in the staging environment and then convert to absolute when the site is published to the Web.

    • Richard V. Burckhardt on Jun 5, 2008 at 1:32 pm

      Catfish -

      Sounds like a good solution. The company I am working with had similar issues. They want relative URLs in their development and staging environments. Problem is, they’d move it over to the live site and get spidered in both http and https, so the search engines saw two sites. All it takes is one https link.

      After several attempts at fixing this through templates, they put their development team to work on a way to identify the https links and redirect them to the http version of the page.

      So, if you have the resources, there are definitely ways to work with relative links. For the rest of us, though, absolute links are still the best route to avoid headaches.

    • Ashwin Ramesh on Jun 5, 2008 at 11:06 pm

      Andrea,

      Taking the Search Marketing into the focus and perspective, definitely absolute > relative.

      Not just because we’re giving more details to the search engines with absolute url’s, but also because its a whole lot more effective when it comes to garnering natural links and also effectively doing better in the SERPs.

      I’ve had quite a few curious expeditions where I tested out to see whether absolute URLs seem to have an edge over relative URLs and my conclusions were that, if I want my client to have a very well SEO’d site, i’d rather go for absolute linking structure.

      So, it finally boils down to the question of whether you want to worry about faster page load time or you want to worry about better SERPs and usability.

    • SEM- India on Jun 6, 2008 at 1:20 am

      Absolute URL are good to use, it will definately solve the url cononicalization issue.

      but most of CMS, web2.0 sites and cms uses relative URL, i did not seen any harm on their ranking or seo?

    • Web Agency Chieti on Jun 6, 2008 at 2:13 am

      @Raghavan
      I don’t use skype at all. Send me an e-mail at andrea . moro (dot) webma (at) gmail.com

      @Ashwin
      Thanks for your clarification. I certainly don’t avoid absolute url linking. In most web page I use them, especially for high-value links or very important pages.
      But as I said I prefer relative for off-line testing, and actually I’m able to get results anyway.

      Andrea

    • SEO Findability on Jun 6, 2008 at 3:07 am

      I think most SEO Experts would prefer Absolute, because why should you make it the SERP mopre difficult by using relative.
      Most important is to use the same URL’s internal as external and use clean URL’’s.

    • Jim on Jun 6, 2008 at 10:23 am

      Question: Is there any difference in using the base tag vs. using relative URLs? Would search engines see them differently?

      Good post Ann!

    • Richard Burckhardt on Jun 6, 2008 at 10:47 am

      No, but if your content got scraped, you’d lose any backlinks (for whatever they’d be worth) because the links would be relative since the base tag would be missing.

    • CT Moore on Jun 6, 2008 at 11:10 am

      In regards to the whole divide between SEOs and developers/programmers, that seems to be symptomatic of a more pervasive split between techies and marketers in general.

    • MikeBradbury on Jun 6, 2008 at 1:50 pm

      Why don’t you just use a .config file to set a variable called , and then set that equal to the domain?

      If you set the URL in a .config file on the server side, you can use a placeholder in your pages like /rest-of-url.php (I believe Joomla does this)

      You can set the for your development site as well as the live site, you get absolute URLs all over the site, and the search engine is none the wiser.

      TaDa!

    • MikeBradbury on Jun 6, 2008 at 1:53 pm

      A few words were eliminate because I formated them like html tags. I am a moron.

      Basically, set a baseurl in a universal .config file and then call it when you write your pages on the server side.

    • Dawn Siemer on Jun 6, 2008 at 6:07 pm

      One reason to use absolute URLs nobody else mentioned is for copywriting purposes. I often copy/paste code from webpages for newsletters, new pages, and online submission forms. Having an absolute URL re-assures me that I won’t be breaking any links by doing so.

    • Matt Hopkins on Jul 1, 2008 at 9:13 am

      So I guess nobody uses log file based analytics anymore then? Cos if they did then they would point out that using absolute URLs screws up the analytics enromously as your visits will only have 1 page view and all your referrers will be your own site.

    • Oscar Meneses on Sep 8, 2008 at 9:04 am

      If you use a scripting language on your site like PHP, you can set a constant variable with your domain name (http://www.mysite.com) and then call the variable in front of every link you’re going to make. That way you would have absolute URLs and when you change domains or are in testing mode you can change the value in only one place. And to get relative URLs you would assign a blank value to the variable.

    • Richard Burckhard on Sep 8, 2008 at 9:20 am

      Oscar -

      Very nice suggestion. Thanks!

    • Nir Levy on Sep 16, 2008 at 9:35 am

      Hey.
      i’ve also blogged abit about this issue. I always do my best to use relative urls. They are cleaner, easier to understand, can be staged and more. As a developer i would consider this a bug in the crawler if it gave better ranking to an absolute url then a relative one.
      Also, i believe that since relative urls are shorter your pages will preform better SEO wise: if you have a top or left menu of 30 items, for example, and your domain name is www.searchenginejournal.com you will add over 1kb to the top of the html of your page. that makes your real content 1kb further down the page which makes the search engine give it lower rank (or so i’m told).

    Leave a Comment