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
2 Answers
Then just use :
<a href="/">home</a>
or
<a href="/index.html">home</a>
3 Comments
vytfla
Awesome, "/" works. Obviously... I don't want to use /index.html... because the URL will show that.
Laurent S.
yep, I placed it there just in case :-)
ncubica
also you can do things like <a href="/?var=1">send...</a> will send the var 1 to the index page on the server...
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/
1 Comment
Laurent S.
and what if his site has multiple domain names ?
<a href="http://whatever.com/index.html">Home</a>?"/"(no period).