Base Tag and SEO – Complete HTML Reference Guide for SEO

Base Tag and SEO

Those of you who heard about this tag, raise your mouse :) How many? 5% only? Don’t worry, I actually think that less than 5% of the web developers are aware of this tag and I think that, in this case, ignorance is gold.

For me it’s been 5 years since I stopped using this tag. It gave me more headaches than any other html elements and the benefits were minimal.

Some developers asked me is if the base tag is the same with rel=”canonical”. The answer is NO. There’s huge difference actually. The former specifies the default URL to be used by browsers while the latter is used by search engine to identify which page matters the most, among other very similar pages. However keep in mind that when it comes to duplicate issues and crawling problems, the <base> tag can create problems. My advice is to not use this tag at all; search engine bots (the ones which matter) are good enough at identifying links and following them and your programmer should know how to handle root URL as variables.

Definition and Usage

The base tag specifies a default URL and a default target for all links on a page:

<head>
<base href=”http://www.w3schools.com/images/” />
<base target=”_blank” />
</head>

For more information on optional and standard attributes of this tag please visit the HTML <base> tag page on w3shool website .

w3schoolDesigners should know

  • Make sure that the <base> tag is placed before any links to any CSS or JS files in the <head> section

SEO professionals should know

  • you need to check if the internal links from your website are not pointing to dead pages (404 errors)
  • Make sure that you check your site using Xenu LinkSleuth for any linkage problems

Programmers should know

I apologize for the lengthy list below, but this tag is all about programming:

  • make sure the base tag includes the full URL to the current folder level, or to the full URL of the page it is on. Essentially, the base tag treats relative URLs as absolute URLs by adding its href value to any relative URL
  • experiment with how different types of URL format within links on your site (relative, root relative, and absolute) interact with that tag before you use it in real life
  • if you use absolute linking within your site (like “http://www.example.com/folder/page.html”), or use relative links which count from the root (i.e. begin with a slash, like “/folder/folder/page.html”) then the URL in the “base” tag only needs to be “http://www.example.com/” as in, the root domain
  • if you use relative links (i.e “folder/page.html” – note that there’s NO leading “/” on URL -, or “../../../folde/page.html”) then the URL in the base tag must be the full URL of the page that it is on. The base tag can help canonicalization even before you get a 301 redirect from non-www to www in place
  • using base href tag is about using relative and absolute paths to your server file. You don’t need to use it if you’re working with absolute paths (ie. a href=”http://www.pitstopmedia.com/services/search-engine-optimization.php”)
  • old school SEOs recommend using this tag only if you reference your file relatively (ie. a href=”services/search-engine-optimization.php”). However, I think that tag is not necessary if you know what you’re doing when working with relative paths. In the end it’s about how search engine spiders will parse the links
  • if a base element is present, it makes selecting text quite a challenge in Internet Explorer
  • base tag could prove to be a valuable resource, but it also can be a nuisance. The root URL is defined as a server side variable in the majority of web development platforms, and using that as opposed to a base has proven to be much more useful..
  • Google’s cache adds a base tag set to your own domain root URL. If your page is using a different base tag this will result in broken images, missing scripts and css files – all of those end up even more broken than the usual cached version.
html code using the base href

Google Cached Page with Added Tag

Copywriters should know

  • phew, at least you don’t worry about this tag

Pitstop Media offers ROI based internet marketing services such as SEO services. If you need help with your search engine optimization projects please contact us for a free, no obligation quote. We’ve helped companies rank on the first page of Google in a short period of time for highly competitive terms. Let us rank your website on the first page, too!

VN:F [1.9.11_1134]
Rating: 8.7/10 (3 votes cast)
VN:F [1.9.11_1134]
Rating: +2 (from 4 votes)
Base Tag and SEO – Complete HTML Reference Guide for SEO, 8.7 out of 10 based on 3 ratings
 

2 Responses to “Base Tag and SEO – Complete HTML Reference Guide for SEO”

  1. Htaccess Redirect said:

    Jan 30, 11 at 8:35 am

    Thanks for this article — I guess my question coming out of this is it is best to use the canonical tag now if we’re having troubles getting the bots to index the url we want to use as our canonical/main url? On one server where I have some sites hosted support has been stumped about why the main index page for my sites is being indexed as http://mysite.com while internal pages are all indexed as http://www.mysite.com. I set up a simple 301 htaccess redirect which works just fine, but Google still isn’t indexing the main index page as http://www.mysite.com – it keeps defaulting to http://mysite.com for the main page despite the redirect, despite creating a fair amount of backlinks which all poitn to the www. version – and this has been going on for months now. I was wondering if adding the base tag would help me, but it sounds more like the canonical tag would be smartest? Thoughts?

    VA:F [1.9.11_1134]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.11_1134]
    Rating: 0 (from 0 votes)
  2. TraiaN said:

    Feb 01, 11 at 11:28 am

    check your google webmaster tools account and setup the desired URL. It may take some time for Google to readjust the settings, but it should work. Also, make sure the 301 redirect is properly done by checking your header response. Then, check your entire site with Xenu Link Sleuth and see if you’re linking your pages without www.

    VN:F [1.9.11_1134]
    Rating: 0.0/5 (0 votes cast)
    VN:F [1.9.11_1134]
    Rating: 0 (from 0 votes)

Leave a Reply