简体   繁体   中英

How do I make a website work so that "index.html" does not appear on my home page's link after the website name?

After uploading to a web hosting service, my home page has a name as follows: example.com/index.html Is there any way that I can change the index.html in the link to "home" or something else? I am using Bluehost if that helps.

index.html is designed to never show up in URLs to users. index.html is the document powers requests for the directory. If index.html is showing up in your URLs, that usually means that you are linking to the home page incorrectly.

Modify your links:

  • <a href=http://example.com/index.html><a href=http://example.com/>
  • <a href=/index.html><a href=/>
  • <a href=index.html><a href=./>

Of those, I would suggest using <a href=/> to link to our home page. That is a site-relative link to your home page. It will work on any page on your site, regardless of how deep in directories it is. Unlike absolute links, it is easy to use the same code on a live server and on a staging server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM