You are not logged in Log in Join
You are here: Home » Members » The Zope presence of Dylan Jay » Redirector 1.1 » Redirector 1.1 README

Log in
Name

Password

 

Redirector 1.1 README

Redirector

Copyright � 1999 Alexander Staubo.

Extended 1999 Dylan Jay.

  ANY USE BY YOU OF THE SOFTWARE IS AT YOUR OWN RISK. THE SOFTWARE IS PROVIDED
  FOR USE "AS IS" WITHOUT WARRANTY OF ANY KIND. TO THE MAXIMUM EXTENT
  PERMITTED BY LAW, THE AUTHOR (ALEXANDER STAUBO) DISCLAIMS ALL WARRANTIES OF
  ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, IMPLIED
  WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. THE AUTHOR (ALEXANDER STAUBO) IS NOT OBLIGATED TO PROVIDE
  ANY UPDATES TO THE SOFTWARE. SO THERE.
  

What it Does

Redirector is an experimental folder product for redirecting object requests. Any request to a subobject (whether it exists or not) in the folder is redirected to a designated target URL. A flexible mechanism for mapping specific URLs is also provided.

For example, you might have an URL such as http: //oldserver/foo (running Zope, of course) which you've moved to your brand new server http://newserver/bar (Zope not required). Once you have deleted or moved the foo folder or object out of the way, create a Redirector object called foo, set its Target property to http://newserver/bar, following which requests for http://oldserver/foo will then be redirected to http://newserver/bar. Given this, if a user then requests http://oldserver/foo/fnargh, the request will simply be redirected to http://newserver/bar/fnargh. In fact a call such as http://oldserver/foo/fnargh/something/doSomething?param=blah will also correctly redirect to http://newserver/bar/fnargh/something/doSomething?param=blah

The Redirector object also supports exceptions to this rule: For example, if the old server had a subobject called milk, which now exists on the new server under the name of honey, then you can create a mapping which simply maps the old object to the new object. Mappings support (or rather, require) regular expressions to be used, so you could also map any object starting with the letter M to a specific object. Regular expression groups are supported. A \n where n is an integer in the replacement field will be replaced by the corresponding group in the FROM: field. See the python regular expression syntax for clarification on this.

Added bonus feature: If you set the Redirector to "hard mapping" mode, it will fall back to the default target URL if none of the mappings match the requested URL. That means -- if you're like me, converting a dull old Netscape server to a new Zope site with lots of magic fairy dust added -- that you can create mappings for all the old documents that should be redirected to their Zopefied counterpart URLs, but for all the documents that are deprecated on the new server, the redirection will be set to the server's root folder.

Whats New

  • Support for redirection of whole subtrees
  • Support for redirection of query string
  • Grouping in the maps

Documentation

File under "self-explanatory". In short, what you're seeing here is what you get.

Bugs and Such

This being an experimental Zope Product, I can't promise that it will work as promised. Indeed, I won't promise anything. I can only give the typical excuse that "it works here".

Please report problems to me. If you include the line "This is important and you're just one dandy programmer, Alex!" I'll promise to give you lots of priority.

Future Improvements