[Zope] Handling bad URLs

Evan Simpson evan@4-am.com
Sun, 14 Nov 1999 21:52:24 +0000


Clarence Gardner wrote:

> Well, I did bad :(  I sent out a mailing to a large membership list
> asking them to visit my Zope site.  The URL was of the form
>   /a/b?id=98723
> where the id number is different for each person and opaquely identifies
> their record in the database.
>
> My problem is that I had a typo in the message, and the URL I actually
> sent was
>   /a/b/id=98723
>
> Now everyone who visits gets a 'Resource not found' error, unsurprisingly,
> and sadly, since the URLs are all unique, I can't put in a page telling
> them how to correct it.

You could use a SiteAccess Access Rule to redirect them to the correct page.
Placed in 'a', it would check if the next path element is 'b' and the
following one starts with 'id='.  If so, it would redirect to the same URL
with the last slash replaced with a '?'.

Cheers,

Evan @ 4-am