Toy 4 · two minutes

A site is a folder.

Type a path after the domain and see which file answers. Then rename index.html and see what happens to the home page.

The site's folder

  • what whoever mistypes the address sees
  • the “about” page
  • the main page
  • a photo
  • how everything looks

The file that answers:

despre/index.html

Its short address: https://numele-tau.ro/despre/

A site is a folder

The address in the browser's bar is the way to a file in the folder. The part after the domain is the path: /poze/pisica.jpg is the file pisica.jpg in the folder poze.

When the path ends with a folder, the server gives the index.html file inside it. That's why the main page is called index.html: it's what whoever types just the domain gets. If the file doesn't exist, they get the 404 error, or your 404.html page, if you have one and told the server to use it (on weird, with one line in _redirects: /* /404.html 404).

Relative links, like poze/pisica.jpg, work wherever you put the folder: on your computer, at an IPFS address or at your domain.

Two optional files can sit next to index.html. _redirects says where a page that moved has gone, and which page a missing address gets (your 404.html, for example). _headers gives the browser instructions, such as how long to keep your pictures. On weird both are read at your own address and on a free address.

More in the course

In the terminal

# see the folder on your computer, as online$ python3 -m http.server 8000# then put it online$ weird storage add ./site
Every command and its flags, in the documentation

Tell your assistant

„I have a folder with index.html, stil.css and a photo. Check that my links are relative and tell me what address each file will have at my-name.ro.”