When first connecting to a server via a suitable application you’ll see something like this:
.htm
or .html
. Either extension can be used, although you must be sure to be consistent to avoid complications with links.To establish a working site at https://
, for example, just upload all the necessary items into the public_html
folder. Typically, the the www
folder has the same content, which exists to accommodate the addressing of https://
.
Every web page consists of a text file containing Hypertext Markup Language (HTML), of which more will be said later. When viewed in a web browser application this is translated into the appearance intended by the site designer, a process known as rendering.
When a visitor arrives at mysitename.com
, the browser always looks for a home page at https://
or https://
. That file, essential for a website to work, is then automatically opened.
For a very simple site you would put these files in the public_html
folder:
In this instance index.htm
is the home page, logo.jpg
is an image on that page and style.css
is a Cascading Stylesheet (CSS) file that determines the appearance of the page. All these elements are needed, even for a simple site. Image files can be of varying types: JPEG (.jpg
or .jpeg
) files are for photographic images, GIF (.gif
) files are for line art and low resolution moving images, and PNG (.png
) files are for almost anything. Modern browsers work with any of these formats.
Here’s a more complex site:
In this example there are other supporting pages in the site, each containing an index.htm
or index.html
file. This makes it easier when providing links for visitors. For example, if you give someone an address of mysitename.com/
, the browser will instantly go to https://
or https://
.
In the above example the logo.jpg
file and style.css
files have been relocated into a new style
folder, which can be used to store graphics and other files shared across the entire website.
The contents of the above history
folder could be formed of chapters, as shown here:
The mc.jpg
file provides a graphic for the contents page, index.htm
, whilst each of the chapter folders, with 0
as the introductory page, contain their own index.htm
or index.html
files, as well as any necessary graphics. For more than 10 pages you should start the folder numbering with 00
, 01
etc.
It’s important that your website appears to the world as a secure site, using HTTPS, not HTTP. Although the use of HTTP isn’t a real problem for a small site that doesn’t exchange information with the public, an insecure warning in web browsers does little to instill confidence in the site.
If you’re unsure about whether your site will be secure or not, proceed as follows:
index.html
to the public_html
folder.https://
. If not, your site is insecure.If your site is insecure you’ll need to modify or create the hypertext access file, which has the name .htaccess.txt
and is located your server’s topmost directory (see above). This file determines much of the underlying workings of your site.
.htaccess.txt
is given the name _htacess.txt
in some computer operating systems, since a full stop at the beginning of a filename often renders the file invisible. This character replacement makes no difference to how the file works.This file may not exist in a pristine setup, but you can create it from scratch. It should be a standard UTF-8 file (see later) containing the following three lines:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://mysitename.com/$1 [R,L]
If the file already exists you can view its contents. If you’re unsure how to proceed you may need to ask for advice from your service provider on how to add the necessary lines.
Having done this, you’ll need to ensure that all links to external sites in your web pages are addressed beginning with https://
, even if they’re not secure. For example, to link to the site http://xyz.com
you would use https://xyz.com
. Any browser going to that link will first try HTTPS and fail, but will then try again with HTTP and succeed.