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
Take a look at http://www.dataflake.org/software/jredirector -- Andy McKay Agmweb Consulting http://www.agmweb.ca ----- Original Message ----- From: "Howard Hansen" <howardh@halfmagic.com> To: <zope@zope.org> Sent: Thursday, September 05, 2002 9:14 AM 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
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
(Belated) Thanks Andy! This is perfect. I had envisioned something that hooked into the acquisition process, but this one simplifies by adding a couple of lines of code to standard_error_message. Howard Hansen ----- Original Message ----- From: "Andy McKay" <andy@agmweb.ca> To: "Howard Hansen" <howardh@halfmagic.com>; <zope@zope.org> Sent: Thursday, September 05, 2002 9:31 AM Subject: Re: [Zope] Site evolution and redirection strategies
Take a look at http://www.dataflake.org/software/jredirector -- Andy McKay Agmweb Consulting http://www.agmweb.ca
----- Original Message ----- From: "Howard Hansen" <howardh@halfmagic.com> To: <zope@zope.org> Sent: Thursday, September 05, 2002 9:14 AM 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
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Howard Hansen wrote:
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.
Are you using apache in front of zope? If yes, take a look at the RewriteMap directive, http://httpd.apache.org/docs/mod/mod_rewrite.html#RewriteMap I guess this beast is a little bit more resource friendly than a python script approach, since you will have to run this script at every request. cheers, oliver
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
Hello Howard,
...This morning I got a list from my boss of old URLs and their new names,...
If the list is short enough to be manually handled, you can try this in your "standard_error_message": (Freehand and untested!) <dtml-if "error_type=='NotFound'"> <dtml-call "REQUEST.set('URL_TRANSLATOR', { '/oldurl1':'/newurl1', '/oldurl2':'/newurl2', } )"> <dtml-if "_.str(PATH_INFO) in URL_TRANSLATOR.keys()"> <dtml-call "RESPONSE.redirect(URL_TRANSLATOR[_.str(PATH_INFO)])"> </dtml-if> </dtml-if> Beware of possible recursions with this! Greetings Sven -- Sven Rudolph, Programmierer GermanMedicalServices.de GmbH Unter den Eichen 5, 65195 Wiesbaden Tel.: 06 11 / 97 46 25 2
participants (6)
-
Andy McKay -
Charlie Reiman -
Howard Hansen -
Howard Hansen -
Oliver Bleutgen -
Sven Rudolph