Web Hosting: Difference between revisions

From pronounmail wiki
Jump to navigation Jump to search
No edit summary
Teeth (talk | contribs)
websites as directories; index.html
 
Line 1: Line 1:
Using the power of the [[Shell Access|shell]], you can put files in your <code>public_html</code> folder and have them be served over the [[World Wide Web]].
Using the power of the [[Shell Access|shell]], you can put files in your <code>public_html</code> folder and have them be served over the [[World Wide Web]].
== what exactly is a website ==
When you type in a URL and hit enter, your computer (the client) talks to another computer (the server) and asks it if it has that URL. The server could be running special software, or it could just be serving files out of a folder. In our case, we're doing the latter. When you ask the server for <code>yourwebsite/hello.html</code>, it looks in your <code>public_html</code> folder for a file called <code>hello.html</code>. If the server finds the file, it's sent over to the client, otherwise, you get an error 404. You can also put folders inside of folders and serve things out of there.
=== index.html ===
While exploring, you might notice a special file called <code>index.html</code>. When you add a file with this name into a folder, it tells the server that this file can be shown to anyone who asks to see just the folder. Think of it like a home page for that whole folder. For example, if you've got a folder at <code>public_html/hello</code> and you put a file called <code>index.html</code> inside, then anyone who goes to <code>yourwebsite/hello</code> will see the contents of <code>hello/index.html</code>. Sometimes other special files can serve a similar purpose to this like the special <code>index.php</code> file used by [[PHP]].
[[Category:Pages with some amount of information in them]]
[[Category:Pages with some amount of information in them]]
[[Category:Pages that need things added to them]]
[[Category:Pages that need things added to them]]

Latest revision as of 02:04, 6 February 2025

Using the power of the shell, you can put files in your public_html folder and have them be served over the World Wide Web.

what exactly is a website

When you type in a URL and hit enter, your computer (the client) talks to another computer (the server) and asks it if it has that URL. The server could be running special software, or it could just be serving files out of a folder. In our case, we're doing the latter. When you ask the server for yourwebsite/hello.html, it looks in your public_html folder for a file called hello.html. If the server finds the file, it's sent over to the client, otherwise, you get an error 404. You can also put folders inside of folders and serve things out of there.

index.html

While exploring, you might notice a special file called index.html. When you add a file with this name into a folder, it tells the server that this file can be shown to anyone who asks to see just the folder. Think of it like a home page for that whole folder. For example, if you've got a folder at public_html/hello and you put a file called index.html inside, then anyone who goes to yourwebsite/hello will see the contents of hello/index.html. Sometimes other special files can serve a similar purpose to this like the special index.php file used by PHP.