Link to index page of website

前端 未结 3 1860
有刺的猬
有刺的猬 2021-02-02 10:00

Is there a way to link to the index page of a website without specifying the name of the index page or the full website URL?

I have this:



        
3条回答
  •  一个人的身影
    2021-02-02 10:57

    I know this post is old and has an answer. But here is my contribution that also supports index that is not exactly in the root directory

    to goto

    mydomain.com/index.html
    

    without index.html showing in address bar

    Home
    

    this will always point to mydomain.com no matter where the directory your file was saved to.

    to point to the index in a directory use this:

    Home
    

    this will point to mydomain.com/subdir for mydomain.com/subdir/index.html while the accepted answer will always point to mydomain.com (and this is not always the desired action)

提交回复
热议问题