Naming HTML docs

I am learning HTML/CSS from a book and when I save a html doc, sometimes the browser will open it and sometimes not. Is there a naming convention? For example, I named a file sample.html, and the browser did not show the page and I get error 404. What am I doing wrong>

Hi

It looks that the name “sample” is blacklisted

How to Name Files

home page = index.html or index.php

Do Not Use Special Characters

For best results, you should only use the letters a-z, A-Z, the numbers 0-9, hyphens (-), underscores (_) and periods (.). Any other character could get you in trouble, causing the file not to load or the page to load incorrectly.
it is best to use lowercase letters, also Do Not Use Any Spaces

I double checked this, but it doesn’t seem to be blacklisted.

However, it is very important to note that our servers (like almost all web hosting servers) are cAsE sEnSiTiVe. So if you if you have a domain example.com and a file named Sample.HTML, then you need to enter example.com/Sample.HTML in your browser. If you try to visit example.com/sample.html or example.com/Sample.Html, you will get a 404 error, because Sample.HTML and sample.html are different files.

To avoid this, I second what @Oxy said: always use lowercase letters in website file and folder names.

Hi,

Now I have another file and I still can’t open it:
http://www.senseanalytics.epizy.com/headfirstlounge.html

why is this?

image

This file does not exist and this is probably the reason (it contains something that triggered protection)

https://infinityfree.net/support/why-are-my-files-deleted-after-uploading/

the file is in the new folder

I understand that I can create subdirectories

If the file is in a sub folder, you need to include the sub folder in the URL as well. So if you upload the file to the “New” folder, you can access it through the URL http://www.senseanalytics.epizy.com/New/headfirstlounge.html

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.