I have implemented a simple custom 404.myt template.  When the template
is rendered there is a '/error' prefix generated in the url's from my
autohandler.

In error.py I have made this change to ErrorController:
    def document(self):
        code = request.params.get('code', '')
        if code == '404':
            c.title = 'No Such Page'
            return render_response('404.myt')
        else:
            page = error_document_template % {
                'prefix': get_prefix(request.environ),
                'code': code,
                'message': request.params.get('message', ''),
            }
            return Response(page)

The 404.myt file sits in the usual templates folder and has a simple
error message in it.

My autohandler has some links in it like this:
<% h.link_to('Products', h.url_for(action='products')) %>

On my regular .myt files the h.link_to renders as I would expect, like
this:
<a href="/products">Products</a>

But when 404.myt is rendered from the code in my modified
ErrorController, the result for h.link_to is:
<a href="/error/products">Products</a>

How do I eliminate the '/error' prefix?

Thanks,
Bill


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to