When creating a website with only a handful of pages, a full-blown CMS (such as Drupal, Joomla! or Wordpress) can be more work to set up and maintain than is necessary. In this case, simple, static HTML makes more sense to use. Here are two tips to keep in mind while making static HTML websites.


One way to make your development easier is to use PHP includes to include common elements such as Headers, Navigation and Footers (i.e. any HTML that is repeated across multiple pages). W3 Schools has a good explanation and examples of how and when to use PHP includes.


Once you have all your pages created it is usually preferred to have "clean URLs". Clean URLs are URLs without file name extensions or other non-meaningful text. The code below removes all of the .php endings from your URLs. So if you had a page that was at http://www.example.com/about.php, it could be accessed at www.example.com/about instead. To use this snippet, make sure your server supports the Apache Rewrite module, then copy and paste this text into an empty file. Name the file .htaccess and upload it to the root of your website directory. If you already have a .htaccess file you should be able to append this to what you already have and proceed to save and upload it to your web server.

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule ^(([^/]+/)*[^./]+)$ /$1.php [L]