Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link to index page of website

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:

<a href="index.htm">Home</a> 

But when I click the link, my address bar shows:

mydomain.com/index.html 

I would like it to show:

mydomain.com 

Can I do that without putting the full URL (mydomain.com) in the href? If so, how?

For future viewers, I also found this question helpful.

like image 519
Kendall Frey Avatar asked May 12 '12 11:05

Kendall Frey


People also ask

How do you link an index page in HTML?

To make page links in an HTML page, use the <a> and </a> tags, which are the tags used to define the links. The <a> tag indicates where the link starts and the </a> tag indicates where it ends. Whatever text gets added inside these tags, will work as a link. Add the URL for the link in the <a href=” ”>.

How do I find the index of a website?

You can do a site search by using the search operator. Just type "site:domain.com" and hit enter. You will get the list of all the pages that are being indexed. Now, we know the entire process of how SEO works and how we can check web page indexing.

What is the index page of a website called?

The index page is the URL or local file that automatically loads when a web browser starts and when the browser's 'home' button is pressed. The term is also used to refer to the front page, web server directory index, or main web page of a website of a group, company, organization, or individual.


1 Answers

You can just do this:

<a href="/">Home</a> 

Any href preceded by a slash is relative the root directory.

It should be noted that when viewing a webpage from a local hard drive in a browser, this will cause the link not to function.

like image 99
James Allardice Avatar answered Sep 29 '22 10:09

James Allardice