8 Replies - 1015 Views - Last Post: 01 October 2020 - 01:11 PM

#1 Matthew200   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 47
  • Joined: 20-August 20

How come websites always open on the homepage?

Posted 30 September 2020 - 07:35 AM

Really stupid question I know, but how come? Is it because the homepage is called index.html?

This post has been edited by Matthew200: 30 September 2020 - 07:36 AM

Is This A Good Question/Topic? 0
  • +

Replies To: How come websites always open on the homepage?

#2 Splashsky   User is offline

  • D.I.C Addict
  • member icon

Reputation: 16
  • View blog
  • Posts: 629
  • Joined: 25-August 13

Re: How come websites always open on the homepage?

Posted 30 September 2020 - 07:40 AM

Unless your web server is configured some strange way, it will always look for an index.php or index.html. Someone might be able to answer better than I can, but I'd see how your web server is configured.
Was This Post Helpful? 1
  • +
  • -

#3 Matthew200   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 47
  • Joined: 20-August 20

Re: How come websites always open on the homepage?

Posted 30 September 2020 - 07:42 AM

Got it, thank you. I kinda knew it, but wasn't sure
Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3844
  • View blog
  • Posts: 14,019
  • Joined: 08-August 08

Re: How come websites always open on the homepage?

Posted 30 September 2020 - 07:51 AM

Where would you expect it to open?
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15927
  • View blog
  • Posts: 63,731
  • Joined: 12-June 08

Re: How come websites always open on the homepage?

Posted 30 September 2020 - 07:59 AM

You can dig deeper into the standards for web server directory indexing from the wiki entry:

https://en.wikipedia...directory_index
Was This Post Helpful? 0
  • +
  • -

#6 ndc85430   User is offline

  • I think you'll find it's "Dr"
  • member icon

Reputation: 1050
  • View blog
  • Posts: 4,014
  • Joined: 13-June 14

Re: How come websites always open on the homepage?

Posted 30 September 2020 - 09:25 AM

index.html is an arbitrary name surely? The browser makes a request for a path of / and the response contains whatever the application responds with on that endpoint. The static page (or even the template if that page is dynamically rendered) could be called index.html, but doesn't have to be.
Was This Post Helpful? 0
  • +
  • -

#7 Radius Nightly   User is offline

  • D.I.C Regular

Reputation: 74
  • View blog
  • Posts: 419
  • Joined: 07-May 15

Re: How come websites always open on the homepage?

Posted 30 September 2020 - 03:04 PM

Server have configuration and order what to check and what to return.
For example, if order are "home.html, home.htm, index.php", then it wont return eg. "home.php", because it doesnt exist in order, even if file does exist, without telling him that you wanna request a known file, it wont know what you are looking for only by the link/domain of the site.
This orders are usually on servers like: "index.html home.html index.htm home.htm index.php home.php"
But check your hosting to really know, or if you are running a server, put your own order, maybe "error.html home.php" would suit you (in this example, opening the domain, if error.html exists, it will be open, if it doesnt exist, server will respond with home.php, and requesting directly domain/home.php, server will respond with home.php regardless of any other things in order with higher priority).

This post has been edited by Radius Nightly: 30 September 2020 - 03:07 PM

Was This Post Helpful? 2
  • +
  • -

#8 jon.kiparsky   User is offline

  • Beginner
  • member icon


Reputation: 12076
  • View blog
  • Posts: 20,477
  • Joined: 19-March 11

Re: How come websites always open on the homepage?

Posted 30 September 2020 - 06:11 PM

index.html is a convention that goes back to when the WWW was a collection of glorified file servers, mostly used for distributing pre-prints of academic papers. The "obvious" place to root that tree was at the index of those papers.

Of course, the web has changed substantially since TBL defined the HTTP protocol way back then, and the idea of exposing literal files in a literal file tree on your machine is dying out, so you can expect "index.html" (and ".html" generally) to continue their long fade.
Was This Post Helpful? 3
  • +
  • -

#9 Splashsky   User is offline

  • D.I.C Addict
  • member icon

Reputation: 16
  • View blog
  • Posts: 629
  • Joined: 25-August 13

Re: How come websites always open on the homepage?

Posted 01 October 2020 - 01:11 PM

Jon is right, but in the end it's all server configuration. Because of it's history, index is just the accepted default landing page for a website. Even in modern frameworks, the entry point to the app is 'index.html' or 'index.php' by convention. You can easily modify your Apache .htaccess files or your Nginx server block to have a different entry point.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1