Michael,
Try something like:
if($HTTPS != 'on') {
header("Location: https://".$HTTP_HOST."/".$REQUEST_URI);
}
To help yourself out, try running a page with phpinfo(); while using ssl and while not. You'll see $HTTPS shows up in the Apache environment variables.
Of course, you could hard code the url, but I prefer not to because it simplifies my offline development (but that's a different story).
You probably have to play with the header string. You might also have to check the value of $QUERY_STRING and include that if necessary (i.e.
header("Location: https://".$HTTP_HOST."/".$REQUEST_URI.($QUERY_STRING?'?'.$QUERY_STRING:''));
)
Hope that helps.
Rob