The site_url tag is a single tag which returns the full URL of the site (as defined in the Basic Preferences) as text.
If you maintain local development versions of your live sites and import databases between them, then this tag is extremely valuable for ensuring your domain links are never confused (thus broken) between the two locations (see example 1).
Maintain accurate domain paths
The idea is that you don’t break URL paths after importing a database from local development to live, or visa versa. By using this tag it will automatically be relative to a given site and you’ll never have to manually edit broken domain paths again. A classic example is with navigation links.
<ul id="navmenu"> <li class="articles"><a class="nopad" href="<txp:site_url />articles" title="Articles">Articles</a></li> <li class="photos"><a href="<txp:site_url />photos" title="Photographs">Photographs</a></li> </ul>
HTML header paths
<link rel="shortcut icon" href="<txp:site_url />favicon.ico" />
Display a hyperlink to download a text file
<a href="<txp:site_url />download.txt">Download</a>