Publishing HTML Documents
Everything in this tutorial so far has been focussed on creating HTML documents. Now we're going to talk about publishing your HTML documents.
Saving your HTML Files
Before we discuss publishing your documents, let's talk about saving your documents.
HTML documents are normally saved with a
.htm extension. No special software is required to create an HTML file. You could use a simple text editor for example. However, there are specialized options such as Adobe Dreamweaver that make it easier to create HTML documents.
However, if you need to use a server-side scripting language (such as PHP or ColdFusion), you will need to save your files with the appropriate extension for that language. So you will typically save a PHP file with a
.php extension and a ColdFusion file with a
.cfm extension. Your HTML code will still work because these scripting languages were created with HTML in mind. These files will usually contain a mixture of HTML and server-side code.
Typically, if you save a file as index.html, index.htm, index.php, index.cfm, default.html, or default.htm, this will make it the default file for the directory that it's located in. This means that if someone navigates to a directory without specifying the file name, that file will be displayed.
For example, if you have a document located at http://example.com/html/index.html, the user could access that file by typing in either of the following:
http://example.com/html/index.html http://example.com/html/ http://example.com/html
However, this depends on how the web server is configured. It could be configured to honor
.php files over
.html files, in which case, if there's a http://example.com/html/index.php file in the same directory, the user could only use the first URL above (http://example.com/html/index.html). This is because, typing the following would produce the PHP file:
http://example.com/html/index.php http://example.com/html/ http://example.com/html
Most web hosting companies allow you to configure this to suit your own website. So you can decide which document names are the default pages for your directories.
There are various methods of publishing HTML documents but here are some of the most common methods:
- Blogging platform
- Blogging platforms usually allow you to create "blog posts" by logging in to an administration area and clicking a button such as New Post or similar. They usually provide an HTML editor that allows you to add HTML elements without needing to know HTML. All HTML code is automatically generated as you use the WYSIWYG editor. But you can usually switch to HTML View or similar if you prefer to add your own HTML code. Once a post is ready to go live, simply click a button called Publish or similar. Using this method, all blog posts are stored as data in a database, so there is no need to create a .html document and save it to your local computer.
- Online website builder
- Similar to using a blogging platform, you simply log in to the admin area, create articles, then publish them when they're ready. Online website builders usually allow you to select from a range of templates, add images, and edit articles using a WYSIWYG editor.
- Content Mangement System (CMS)
- This is similar to using an online website builder. In fact, an online website builder basically is a content management system. The reason I separated this one is because, many organizations have their own CMS that staff can use to update their website. This may have been custom built for their organization or it could be an "off the shelf" product.
- FTP your HTML document
- Upload your HTML document to the "live" server. In this scenario, you have a copy of your website on your local computer, and a copy located on a "live" (or "production") server. The live server is located with your web hosting provider (although you could host it yourself if you choose). Typically, you upload files to your hosting provider via FTP (File Transfer Protocol) using FTP software (referred to as an FTP Client) such as FileZilla. You can't use this method if your articles are stored in a database. You can only use it to upload files from a file system.
- Modify the file directly on the server
- This is not recommended, however, it is certainly possible. If you have full access to the live server, there's nothing to stop you editing the files on your website directly. You can double-click on a file, edit it, save it, and your website will be updated with the new change. Just as you would editing a file on your own computer. However, it is better practice to use FTP to edit your website in this case.
- Self-Hosted Websites
- Most websites/blogs are hosted with a third party hosting company (regardless of which publishing method/s they use). Hosting is a 24/7 job and it's usually better to leave it to the experts (assuming your hosting company are experts!). However, it is possible to host your own website—after all, you are connected to the internet just like any hosting provider. To do this, you'll need to know how web servers work and you'll need to be well versed in internet security.
The method you choose to publish your HTML documents will largely be dictated by whether you use a CMS, blogging system, online website builder, or just a simple web hosting account.
If you need a web hosting account, check out our partner site ZappyHost for some of the best deals on the web.
And that's the end of this HTML tutorial. I hope you found it useful!