So I linked my aboutme.html page to my index.html page so I can go to the aboutme.html page from index.html.
Why is it that I can type “<a href=”/"" (typed incorrectly here so it doesn’t hyperlink the following text) and be redirected back to index.html? Does it redirect you to the first file in the folder or is the first name of the main file of a html folder called index?
An index.html file will always be at the root of a directory.
are the same thing. A root folder or directory will always assume it’ll find an index.html file. If it doesn’t, and your server isn’t properly configured, it will show all content inside of that directory.
This needs an index.html
So if it’s not configured properly it’ll show that image? The image “index of /” showing all the other files inside the root folder?
So index.html is the base file (root file) of the directory? Also typing / is the same as typing index.html because / directs you to the root file?
That is correct.
You’ll want to make sure to always have an index.html at the root, if you want to avoid showing all your files to your visitors. This could be a serious security issue, should you have any sensitive data or files that shouldn’t be accessible that easily. But you can find out more about all of this later on.
If you’re currently on aboutme.html, and have a link
<a href="/">Go to index!</a> , it’ll bring you to the index.html page.
Can it be called “Index.html” with an uppercase i or does it have to be lowercase?
Lowercase, always name your files in lowercase.
If it’s saved as Index will it still be considered the root file?
Depending on how your server is set up, file names can be case-sensitive. You could end up having an index.html and Index.html, and you simply don’t want that. As a general rule, always use lowercase. URLs are lowercase anyway, and that’s the example to apply and follow.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.