thank u. In lighttpd, it is difficult to use conditional statments combined with url rewrite. So my solution is do a hack on django. Just use a monkey patch on xxx.fcgi(the fast cgi handler) in order to make error-handler-404 work: Below is my django.fcgi:
--------------------------- django.fcgi --------------------- #!/usr/bin/python import sys, os # Add a custom Python path. cwd = os.getcwd() sys.path.insert(0, cwd) # Switch to the directory of your project. (Optional.) os.chdir(cwd) # Set the DJANGO_SETTINGS_MODULE environment variable. os.environ['DJANGO_SETTINGS_MODULE'] = "settings" # start monkey patch from django.core.handlers.wsgi import WSGIHandler WSGIHandler_old__call__ = WSGIHandler.__call__ def WSGIHandler_proxy__call__(self, environ, start_response): if environ['PATH_INFO'] == '': environ['PATH_INFO'] = environ['REQUEST_URI'] return WSGIHandler_old__call__(self, environ, start_response) WSGIHandler.__call__ = WSGIHandler_proxy__call__ # end monkey patch from django.core.servers.fastcgi import runfastcgi runfastcgi(["method=threaded", "daemonize=false"]) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---