[Zope] Customizing Error pages?

AM Thomas am at virtueofthesmall.com
Fri Jan 9 17:20:40 EST 2004


Actually, Apache has a special directive for this, "ErrorDocument".  
example:

  ErrorDocument 404 /path/to/page.html/or/script.cgi

Note the "404" - I believe you can give different pages for different error 
codes.  I like to use this since I think there's less overhead than for 
using mod_rewrite.

I'm actually using this in a .htaccess file.

Although I realize you've solved your problem, Alec, I hope this is helpful 
for someone else.  I was happy when I found it.

- Ann Marie


On Fri, 09 Jan 2004 17:25:32 -0400, Alec Munro 
<alec.munro at eoascientific.com> wrote:

> Dieter Maurer wrote:
>
>> Alec Munro wrote at 2004-1-9 11:09 -0400:
>>
>>
>>> I'm moving a static HTML site to Zope, and one of the results of this 
>>> is that many, many links are changing. What I'm looking for is someway 
>>> to catch all NotFound Errors, and at the very least, display a small 
>>> explanation regarding our upgrading, ...
>>>
>>>
>>
>> When you use Apache in front of Zope (recommended),
>> you can use Apache's "rewrite maps" to map old to new links.
>>
>>
>>
> Yeah, that's what I ended up with.
> Looks like this, for anyone interested:
>
> RewriteMap old_new txt:/var/www/html/rewrite_map.txt
> RewriteCond ${old_new:%{REQUEST_URI}|none} !=none
> RewriteRule ^.*$ http://%{HTTP_HOST}${old_new:%{REQUEST_URI}} 
> [R=permanent,L]
>
> Where rewrite_map.txt is a text file that looks something like this:
>
> /old_dir/old_file1      /new_dir/new_file1
> /older_dir/old_file2   /new_dir/new_file2
>
> I hope someday this save someone else some time.
>
> Thanks for everyone's suggestions.
>
> Alec
>
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>
>



-- 
Virtue of the Small / (919) 929-8687 / am at virtueofthesmall.com



More information about the Zope mailing list