#!/usr/bin/python
import sys
import os
import cgitb; cgitb.enable()

map = {
"/projects.py": "/projects/",
"/projects/000050.html": "/projects/hep/"
}

requested = os.environ["REDIRECT_URL"]

if requested in map.keys():
	print "Status: 302"
	print "Location: %s\n" % map[requested]
else:
	print """Content-type: text/html\n
<html>
<head>
<title>Not Found</title>
<style>
body {
	font-family: verdana, sans-serif;
	font-size: 9pt; 
}
</style>
</head>
<body>
<div style="margin-top:10%; text-align: center">
<img src="/images/monster.png">
<p>
<h2>Not Found</h2>"""
	print """
Sorry, there ain't no "%s" here.
<p>
<a href="/">fettig.net</a>
</div>
</body>
</html>
""" % requested

