Web Hosting Directory | Web Hosting Resources | Webmaster Resources | Domain Tools | Search Engine Marketing | Forums
  Signup
Today: 547   Yesterday: 1,235   Max: 1,872   Total: 365,182   Current Users : 23 (Member 0) 
DOMAIN TOOLS

WEBMASTER TOOLS

RELATED ARTICLES

SUBMIT AN ARTICLE

Write for us and get publicity, link to your website, and best of all get paid. Please visit our writers page for details.


LINK TO US

Link to us and earn points for each visitor you bring to us. Please visit our link partner page for details.

 

<BASE ...>

Usage Recommendation
thumbs up use it

  • HREF: default address for hypertext links
 
  • TARGET: default window for linked documents

<BASE ...> tells the browser to pretend that the current page is located at some URL other than where the browser found it. Any relative reference will be calculated from the URL given by <BASE HREF="..."> instead of the actual URL. <BASE ...> goes in the <HEAD> section.

For example, consider a page whose URL is http://www.idocs.com/tags/linking/baseexample.php, and the full code of the page is this:

this code produces this
<HTML>
<HEAD>
<TITLE>Example of the BASE Tag</TITLE>
<BASE HREF="http://www.magenta.com/hello.php">
</HEAD>
<BODY>

<A HREF="index.php">go home</A>

</BODY>
</HTML>
this page

The <BASE ...> tag on this page tells the browser to pretend that the page is located at http://www.magenta.com/hello.php. The link on the page makes a relative reference to "index.php". Instead of calculating the full URL of the link as http://www.idocs.com/tags/linking/index.php, the link is calculated as http://www.magenta.com/index.php.

Generally it's best to avoid using <BASE ...>. It usually just restricts the ability to move a set of web pages from one location to another (say, from your computer where you are developing them to the server where they publicly reside). However, <BASE ...> can come in handy in development situations where the final version of the page will make relative references to resources that aren't on the development machine.



Copyright 1997-2002 Idocs, Inc. Written by Miko Sullivan.

 
 
What is your major source of website traffic?
 
 
 
 
 
 

ADVERTISEMENT

 
Cheap Web HostingBudget Web HostingEcommerce Web Hosting
Link to UsLink ExchangeAdvertisePrivacy PolicyTerms Of ServiceAbout UsContact UsSitemap
Copyright © 2006 - 2008 Broadband Media, Inc. All rights reserved.