Nothing is for sale here. Freewill tips keep the site running. Want to help? → Tip via Paypal

HTML Base

The HTML base tag allows you to do a couple of different things.

With the target property, you can have all your links open in a new window—although nowadays that may also mean the links open in a new tab depending on the user’s browser preferences. To target links, just paste the following code in the head section of your page:

<base target="_blank">

I wouldn't use that on every page because it will open all your links in a new tab or window, including links to your own pages. You'll probably want to be strategic about using it. There's an even better use for the base tag though...

...and that’s to identify your root directory on your 404 page. The 404 page is an error page. When a browser tries to connect to a page that isn't there, most web servers will show the 404 error page in its place (if there is one).

When the missing page isn't in the root directory, the 404 page will display without the images. Other external files, such as an external style sheet or JavaScript, won't be called into action either. That 404 page could really be a mess unless you include the base tag with a link to your website's root directory.

With the base website address in place, all your links and references to external files will work no matter which directory the 404 page is being called from—and happy days are here again!

Here’s how to do that:

<base href="http://www.boogiejack.com/">

Just change that from my domain to yours and place it in the head section of your page, before any references to other external files. Place it just after the title tag and you'll be in good shape . . . and by golly, so will your web site's 404 error page!