Skip to content Skip to sidebar Skip to footer

Link Not Going Back To Home Page

I have researched this to death including on this page. My index page is outside my html folder and when I hit the nav link it will not take me back home(index page). I have seen a

Solution 1:

In my opinion the safest way is using

<ahref="/">index</a>

This will move the user to the root directory no matter in which directory the user currently is.

It's quite short which can be helpful too. In most cases you can omit index.html because the server uses this file automatically if you visit a directory.

Solution 2:

I'm no web server specialist, but I'm sure you're saving your index.html in the incorrect location.

Your /html folder is your ROOT folder, anything outside of it isn't accessible via a URL. I'm sure there are ways to override that, but I have never seen anyone do this even in the most complex projects I've worked in.

For example, your site www.yoursite.com is located in the /html of your server. So if you have your index.html file outside of that folder, that file can't be accessed or served at all.

The common sense solution is to move your index.html file to the /html folder. When you do this you can then use a slash in your href, like so:

<ahref="/">Index</a>

Post a Comment for "Link Not Going Back To Home Page"