I have tried to use the approach described here Magento: storing base url in a config file to set my base url from an xml file.
I have put the following in the file baseurl.xml in app/etc. It seems to be loaded (if I put a deliberate error in it, I get an error). However, it's having no effect (I would expect to get a garbage set of links). I wonder if it's because I might have set things through System>Configuration>Web in the past? Is there a way of clearing that out (eg delete entries from the database)? And is there a good reference for where this is documented?
<?xml version="1.0"?>
<config>
<default>
<web>
<unsecure>
<base_url>http://yourdomain/magento/</base_url>
</unsecure>
<secure>
<base_url>http://yourdomain/magento/</base_url>
</secure>
</web>
</default>
<websites>
<ws_code>
<web>
<unsecure>
<base_url>http://yourdomain/magento/</base_url>
</unsecure>
<secure>
<base_url>http://yourdomain/magento/</base_url>
</secure>
</web>
</ws_code>
</websites>
<stores>
<store_code>
<web>
<unsecure>
<base_url>http://yourdomain/magento/</base_url>
</unsecure>
<secure>
<base_url>http://yourdomain/magento/</base_url>
</secure>
</web>
</store_code>
</stores>
</config>