I just uploaded my htdocs folder to public_html in my web hosting service, and the website works correctly, but when pressing the Home button the URL displays the entire server path.
<div>
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="shop.php">Shop</a></li>
<li><a href="contact.php">Contact</a></li>
<li><a href="local_stores.php">Local Stores</a></li>
<li><a href="login.php">Store Login</a></li>
</ul>
</div>
I expect the Home button to bring me back to mydomain.com instead of mydomain.com/home1/company/public_html/mydomain.com
When you just enter the file name, html always prepends the path.
Try using <a href=“/index.php“>Home<a>
The / tells the browser to go for domain.tld/index.php
Figured it out! When in development using XAMP and text editors, you use "index.php" and "otherpage.php" in the a tags. But when in the hosting service, to go back to the "index.php", the href value should be "/" because it'll automatically look for the index.php in the directory it's in.
I used this stack thread to solve the issue: