Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML How to Make a Website Creating HTML Content Build the Footer

David Hobbs
David Hobbs
5,029 Points

when comparing absolute vs. relative links. Which is better for SEO purposes and search engines?

I am curious which links are better for SEO?

3 Answers

Canonical errors can occur more easily with relative links, and you have more control using absolute links. So while not necessarily better, they are safer.

An example mistake that can occur is a relative link producing a URL such as 196.34.662.748/blog. If mysite.com/blog was the intended URL, then you now have duplicate content by search engine standards as well a dilution of page trust.

David, you might also consider if you ever want to change the domain entirely, you'll have to edit all those absolute links to reflect that. There's some debate on this, but I think relative links are a good practice, and Google is getting better at recognizing and not penalizing for duplicate content.

I think using server side code remedies this problem without the increased risk of relative links. There is also the option to run a "replace all" on a domain name in your database or html if you find yourself switching domains.

I'm all about SEO, but I think we should create websites with users in mind, and not so much search engines. At least, that is what Google recommends. As Google rolls out new algorithm updates, websites who have't done this are taking big hits down the SERPs. I think once people realize why Google prefers great content, and their software gets more intelligent, SEO might be much different than what it is today. However, we haven't reached that point entirely.

A successful website should keep both in mind. Especially since good SEO practices today can also promote good UX experience and vice versa (example, always writing image alt attributes)

In this case, the only potential downside I can see for absolute links is on the developer side, not the user's end (although the dev issues are easily remedied with with server-side templating) and since search ability is a factor in the user experience I would argue absolute links are the better choice.

David Hobbs
David Hobbs
5,029 Points

Can you guys explain duplicate content a little further? It seems straightforward enough, but I want to be sure from a search engine perspective.

Thank you.

Hey David, you might check out this video by Matt Cutts.

One thing important to know about search engines like Google, is what they consider a web page to be. You might be inclined to believe that if you put about.html onto your website that this is what Google considers to be a page. What Google actually does is look at the pages URL. So example.com/about.html and www.example.com/about.html might use the same html, but are actually two separate pages in Google's eyes. I cannot attest to when accidental duplicate content truly becomes a problem, but I do know that canonical errors can be significant.

You can learn more about canonical errors here: http://moz.com/learn/seo/canonicalization Basically Google has a number of ways to tell if a web page is good and trust worthy, and when there is a canonical issue, that trust is divided. It is superior to have a very trusted page compared to a couple somewhat trusted pages.

You might also consider adding both the root and www versions of your site to Google Webmaster Tools. You can then change which version is displayed in search results. Adding a sitemap is also helpful for larger sites.