This is the seventh web design for my personal web site. I'm back to PHP after trying ASP.NET. I've determined that ASP.NET does have a very nice advantage, which is being able to code in C#, for very complex web sites. But I missed my UNIX shell, being able to edit pages from anywhere without having access to Visual Studio, and... well, mostly the shell. It lets you do a lot of things on the server whereas with Windows Server you basically do everything on your local PC and then just make the server a mirror.

I'm also using Korax once again, and I couldn't be happier with their service.

PHP

In PHP, I'm still using the technique I came up with for redirecting 404s. This lets me simply make a list of URLs and what page they should actually load. It also keeps the content pages PHP-free. I improved on the previous index.php script to take the header and footer out in to separate files and to get rid of the strict two-level (e.g. /code/projects instead of just /projects) system. Now I just have a mapping of arbitrary URLs to page names. Here's the .htaccess:

ErrorDocument 404 /index.php

And here's the script:

<?

// map of URLs to pages
$pageMap = array (
"/"        => "index.html",
"/about"    => "about.php",
"/books"    => "books.html",
"/links"    => "links.html",
"/resume"    => "resume.html",
"/topcoder"    => "topcoder.html",
"/projects"    => "projects.html",
"/documents"    => "documents.html"
);

// get the part of the url after markhilgart.com/ but not including trailing slashes if any
$request $_SERVER['REQUEST_URI'];
while(
strlen($request)>&& $request[strlen($request)-1]=='/')
{
    
$request substr($request,0,-1);
}

// construct the path to the content file
$contentRoot "/u/h/hilgart/pages/";
$pageExists = isset($pageMap[$request]);
if (
$pageExists)
{
    
$content $contentRoot.$pageMap[$request];
}

// HTML headers
header("Content-Type: text/html; charset=iso-8859-1");
if (
$pageExists)
{
    
header("Status: 200 OK");
}
else
{
    
header("Status: 404 Not Found");
}
      
// read the header, content, and footer
readfile("header.html");
if (
$pageExists)
{
    include(
$content);
}
else
{
    print(
"<font size=+1><strong>Error 404: File not found");
}
readfile("footer.html");

?>

ASP.NET

Here's the explanation of how I wrote it in ASP.NET:

"All the pages on the site are named Default.aspx so the file name can be hidden from URLs and the transition can be smooth if I ever want to move away from ASP.NET. Each page needs five lines to wrap the content. Here's the template for this page:

<%@ Page language="c#" Codebehind="Default.aspx.cs" AutoEventWireup="false"
    Inherits="mh.web.about._Default" %>
<%@ Register TagPrefix="mh" TagName="Header" Src="../../Header.ascx" %>
<%@ Register TagPrefix="mh" TagName="Footer" Src="../../Footer.ascx" %>
<mh:Header id="Header1" runat="server" />

Content goes here

<mh:Footer id="Footer1" runat="server" />
"My host is ORCSWeb, and I'm very happy with them so far. I left my previous host, Korax, because ORCSWeb specializes in ASP.NET hosting and they have SQL 2000 databases available. Everywhere I've read including some Microsoft bloggers agrees ORCSWeb has the best reputation among shared hosting companies for reliability and support, which are paramount to me. I know Korax has the same reputation from four years of experience. I highly recommend both, though I don't have much personal experience with ORCSWeb yet."

Here are screenshots from my last three sites. Sadly the first two are lost forever, and The Internet Archive didn't save them.

2000-2004

1999-2000

1998-1999