# Wow!

**URL:** <https://forum.kirupa.com/t/wow/218303>\
**Category:** Uncategorized\
**Created:** [March 6, 2007, 5:07pm UTC](https://forum.kirupa.com/t/wow/218303 "2007-03-06T17:07:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![duncanhall](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@duncanhall](https://forum.kirupa.com/u/duncanhall)\
**Post date:** [March 6, 2007, 5:07pm UTC](https://forum.kirupa.com/t/wow/218303/1 "2007-03-06T17:07:26Z")

</div>

I’ve just found an HTML tag I never knew existed, and it’s something I’ve wished I had many times before!

The \<base href=""\> tag lets you set a default prefix to all links to external sources.

So for example:

```auto

<html>
    <head>
    <base href="http://www.kirupa.com">
    </head>

    <body>
    <a href="web/index.htm">PHP</a><br />
    <a href="forum">FORUM</a><br />
    </body>
</html>

```

The two links above would point to “[http://www.kirupa.com/web/index.htm](http://www.kirupa.com/web/index.htm)” and “[http://www.kirupa.com/forum](http://www.kirupa.com/forum)” respectively.

You can even set the base href as something like “[http://mydomain.com/folder/subFolder](http://mydomain.com/folder/subFolder)” and then traverse back up the directory tree using “…/” in your links.

I can see how this probably sounds very dull, but I think it’s brilliant, especially as I’ve never heard of it before.

[http://www.w3.org/TR/html401/struct/links.html#edef-BASE](http://www.w3.org/TR/html401/struct/links.html#edef-BASE)
