0

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

Tushar Gupta - curioustushar
  • 58,085
  • 24
  • 103
  • 107

3 Answers3

0

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

Don't Panic
  • 41,125
  • 10
  • 61
  • 80
AndyWHV
  • 1
  • 1
0

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:

Link to index page of website

0

when you are trying to go back to home page try this

Home use only / in your href="/"

this is indicate to index.php and it will not show in your url

Vivek s
  • 11
  • 1