vytfla
vytfla

Reputation: 559

Removing index.html from url with ./

I read somewhere that I can add a href="./" on any page in any sub-directory to send the user to the root index.html file, however this doesn't seem to be working. As the title suggests I am trying to not have /index.html in the URL when the user clicks a home link

Upvotes: 0

Views: 139

Answers (2)

FelixH
FelixH

Reputation: 145

If you are in www.yoursite.com/dir/ and you want to go to your root folder you must use ../ instead of ./

If you want to go back from www.yoursite.com/dir/dir2/dir3/ to your root dir you have to write: ../../../ The best solution probably would be the full path to your root folder: www.yoursite.com/

Upvotes: 0

Laurent S.
Laurent S.

Reputation: 6947

Then just use :

<a href="/">home</a>

or

<a href="/index.html">home</a>

Upvotes: 2

Related Questions