1

I'm trying to make my own ErrorDocument 500 page while using web.py framework.

The problem is that ErrorDocument directive is not working. I have builtin error message instead of my custom one. And also have "Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request"

If I change

ErrorDocument 500 /cgi-bin/error500.py

to

ErrorDocument 500 "Blast! It's 500 error

it works fine.

Also if I set RewriteEngine off ErrorDocument redirect works correctly.

Thank you for your suggestions.

.htaccess:

<Files code.py>
    SetHandler wsgi-script
    Options ExecCGI FollowSymLinks
</Files>

<IfModule mod_rewrite.c>      
  RewriteEngine on  
  RewriteBase /
  RewriteCond %{REQUEST_URI} !^(/.*)+code.py/
  RewriteRule ^(.*)$ code.py/$1 [PT]
</IfModule>

ErrorDocument 500 /cgi-bin/error500.py
4

0 回答 0