Sorry should have explained. I replaced some of the values before posting. Where I use the value 'http://MyURL' the config file in moodle has the correct value for my actual domain.
The config file doesn't seem to be stopping moodle hardcoding exampl.com/moodle into the source code of the page as this is the HTML source on admin/index.php and nowhere in the code does it send the input "agreelicense" with a value of 1 to my website it actual seems to send it to examp.com/moodle/admin/index.php
<div class="region-content">
<span id="maincontent"></span><h2 class="main"><a href="http://moodle.org">Moodle</a> - Modular Object-Oriented Dynamic Learning Environment</h2><h2 class="main">Copyright notice</h2><div class="box copyrightnotice"><div class="text_to_html">Copyright (C) 1999 onwards Martin Dougiamas (http://moodle.com)<br />
<br />
This program is free software: you can redistribute it and/or modify<br />
it under the terms of the GNU General Public License as published by<br />
the Free Software Foundation, either version 3 of the License, or<br />
(at your option) any later version.<br />
<br />
This program is distributed in the hope that it will be useful,<br />
but WITHOUT ANY WARRANTY; without even the implied warranty of<br />
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.<br />
<br />
See the Moodle License information page for full details:<br />
http://docs.moodle.org/en/License</div></div><br /><div id="notice" class="box generalbox"><p>Have you read these conditions and understood them?</p><div class="buttons"><div class="singlebutton"><form method="get" action="http://example.com/moodle/admin/index.php"><div><input type="submit" value="Continue" /><input type="hidden" name="lang" value="en" /><input type="hidden" name="agreelicense" value="1" /></div></form></div><div class="singlebutton"><form method="get" action="http://docs.moodle.org/en/License"><div><input type="submit" value="Cancel" /></div></form></div></div></div> </div>
</div>