Home > Net >  HTML relative URL starts at C drive instead of current location
HTML relative URL starts at C drive instead of current location

Time:09-22

I have my website in the folder C:/Users/username/Desktop/pathname_website. Within the pathname_website folder I have aboutus.htm and index.htm. In aboutus.htm I have the link <a href="/index.htm">Home page</a>. I want it to go to the index.htm file, obviously, but it leads to C:/index.htm, which in addition to being the wrong location, doesn't even exist.

Why is it trying to start at the C drive and not the current location? This is Windows 10. I tested on multiple browsers.

CodePudding user response:

Change it to <a href="./index.htm">Home Page</a>

This path is relative to your codebase

CodePudding user response:

Change to <a href="./index.htm">Home page</a>

  • Related