I have footer.html file in root directory i.e example.com/default/ and I load this file into other html files. Now the problem is in footer.html there are hrefs like
<li><a href="https://example.com/default/contact">Contact</a></li>
When it renders in other file like it renders as footer in
https://example.com/default/page1/index.html
The contact href becomes
https://example.com/default/page1/contact
How can I set root directory in footer.html so that when it render in page1/index.html, the contact href should be like
https://example.com/default/contact
not like
https://example.com/default/page1/contact
Following are the links in Footer.html and this file is in (Directory: https://surgehost.com/template/footer.html)
<ul class="list-unstyled">
<li><a href="https://surgehost.co.uk/template/web-hosting">Web Hosting</a></li>
<li><a href="https://surgehost.co.uk/template/domain-names">Search for a Domain</a></li>
<li><a href="https://surgehost.co.uk/template/vps">Virtual Private Servers</a></li>
<li><a href="https://surgehost.co.uk/template/ssl-certificates">SSL Certificates</a></li>
</ul>
index.html (Directory: https://surgehost.co.uk/template/vps)
<div id="footer"></div>
<script>
$(function(){
$("#footer").load("/template/footer.html");
});
</script>
Now in vps/index.html when I click on web hosting it redirects me to
https://surgehost.co.uk/template/vps/web-hosting
but it should redirect to complete URL i provided hard coded
https://surgehost.co.uk/template/web-hosting
What could be the reason? Please help. I'm losing my mind in this problem.