case modRewriteAppUrl "tutorial/registered" of Left e -> ... Right page -> ...
Given a page path, try to return the home page of a happs server, basically, the host plus an optional path. At the same time, try to deal sanely with HAppS serving behind apache mod rewrite, a common situation for me at least because it lets you have multiple happs servers listening on different ports, all looking to the casual user like they are being served on port 80, and also unblocked by firewalls.
Can fail monadically
getHost = getHeaderVal "host"
returns host with port numbers, if anything other than default 80
retrieve val of header for key supplied, or an error message if the key isn't found