The php script below is included in my website template at the bottom of every page. It works perfectly on domains that are in the form http://somesite.com/page/
However, when the script is run on a site in the form somedirectory.somesite.com/page/, it resolves to the home page every time, rather than the current page (ie, its as if “/page/” where not there.)
return '<a href="#jump" class="backToTop">↑ Back to top</a>';
Update: I believe the problem is caused by my “Base HREF” in the head.
I’d guess that you have a
<base>element in there somewhere, but it is hard to tell with just a fragment of the document.