Wife/Girlfriend/Sister?
Pepper Spray &
Stun Gun Specials!
KEEP THEM SAFE.
 CoverYourASP --> The base href tag

Free membership

Join in the fun! Sign in
Member Services

Site navigation
Download the entire site!
Search my articles
Free Magazines
Browse the directory

Send me feedback
Buy my boxer shorts

Recommend this page
Printer-friendly page

Resources I recommend
Link to my site
Advertising slashed!
About your privacy
Legal stuff
Site statistics
51 active users
4034 visitors today
6773 pages today
how is this done?
Tools I use

CoverYourASP
Copyright © 1999-2010 James Shaw.
All rights reserved.

ASP.NET Blog
RSS submissions
E-commerce

Now open source with SourceForge!

Some history (if you're interested!)

I have tried various methods of maintaining the links to pages on my web site. Initially, all links were relative, not absolute, so I would use:

<a href="Hello.asp">go to my hello page</a>

instead of:

<a href="http://CoverYourASP.com/Hello.asp">go to my hello page</a>

This made it easy to move pages between my development server at home and the production server hosted by my ISP.

Unfortunately, I then had a problem with my 404 error handler when some spiders crawled the site. It's a long story, but they would cause the relative links on my pages to be applied from non-existant folders, causing an infinite loop of 404 errors!

So I then "fixed the problem" by using absolute links in the header and footer - no matter how the 404 was generated it would always show spiders the same absolute links.

But that made it difficult to use on my development machine, and yours. All the links in the header and footer pointed to the real CoverYourASP site!

Part 2: Using <base href>...

Featured sponsor
My favorite resources

Tiki Statues - Tiki Masks - Tiki Totems



See my source code
wherever you see this icon...

You can also download the entire site source code for FREE!


Qualify for Free Trade Magazines

Free subscriptions to industry leading publications for those who qualify!