[Zope] Site evolution and redirection strategies

Charlie Reiman creiman@kefta.com
Thu, 5 Sep 2002 09:47:42 -0700


I was just faced with a similar problem. I considered doing something sneaky
or trying to foist the redirections onto my Apache guy. But I realized there
just weren't that many and they'll never change so it was easier to just
copy, paste, and edit simple python scripts.

Mine look like this:

container.REQUEST.RESPONSE.redirect(container.sub.index_html.absolute_url()+
'?sub_page=solutions')

I don't have a good reason for using python or DTML here, but I do suggest
you use absolute_url. If you don't, you'll encounter problems if you decide
to host your site behind apache with VHM. It also has the advantage of
trapping errors earlier if the target object is missing and it doesn't hurt
you if you don't host behind Apache.

Now, if someone added a 'Duplicate' button to the ZMI... that would have
been handy. This check, scroll, copy, scroll, paste, check, scroll, rename
cycle is a bit ridiculous. I guess that'll have to be me :-)


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Howard Hansen
> Sent: Thursday, September 05, 2002 9:14 AM
> To: zope@zope.org
> Subject: [Zope] Site evolution and redirection strategies
>
>
> We're contemplating some major changes to our sites that will break many
> existing URLs.  In our first transition (from Front Page to Zope!), I
> handled the issue by matching the old URLs and creating a few DTML Methods
> with code along the lines of:
>
>     <dtml-call expr="RESPONSE.redirect('index_html')">
>
> This works fine, but it's not terribly clear what's going on.  It
> seems like
> it would be reasonably trivial (i.e., within my powers) to create a python
> product that stored the new destination and performed the
> redirection.  This
> product would have the advantage of looking different than a simple DTML
> method.
>
> This morning I got a list from my boss of old URLs and their new names,
> which got me thinking....  What if there existed a centralized redirection
> product that allowed me to enter lists of old and new URLs and have the
> redirection automagically happen?  Seems to me that this starts
> to get into
> the realm of acquisition and other deep voodoo magic best left alone.
>
> I'm leaning toward creating the simple product and leaving it at that, or
> perhaps additionally creating a script that generates the redirect objects
> automatically from my list of old and new URLs.
>
> So I'd love to hear your wisdom.  How have people handled this problem in
> the past?  Do products like these already exist?  Are there any
> gotchas that
> I haven't considered?
>
> Any and all help appreciated, as always!
>
> Howard Hansen
> http://howardsmusings.com
>
>