--- ModPythonHandler.py.orig	2005-09-17 04:06:51.000000000 +0900
+++ ModPythonHandler.py	2005-09-18 06:12:22.000000000 +0900
@@ -128,7 +128,8 @@
     req.write('<html><head><title>Available Projects</title></head>')
     req.write('<body><h1>Available Projects</h1><ul>')
     for project in os.listdir(dir):
-        req.write('<li><a href="%s">%s</a></li>'
+        if os.path.isdir(os.path.join(dir,project)):
+            req.write('<li><a href="%s/">%s</a></li>'
                   % (href_join(mpr.idx_location, project), project))
     req.write('</ul></body><html>')
 
@@ -166,8 +167,12 @@
         env_name = mpr.cgi_location.split('/')[-1]
         env_path = os.path.join(env_parent_dir, env_name)
         if len(env_name) == 0 or not os.path.exists(env_path):
-            send_project_index(req, mpr, env_parent_dir)
-            return None
+           if(options.has_key('TracUriRoot') and \
+            mpr.req.uri == options['TracUriRoot']):
+              send_project_index(req, mpr, env_parent_dir)
+              return None
+           else:
+              raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND
         
     try:
         env = None
