Saturday, January 21, 2006

On the Archive: An iteresting aspect of moving to a dynamic site was how to support old links. There are links out there to pages like

http://famousfamily2.dnsalias.org/JenMark/MarksFolders/133_3394.html

That page is now defined as

http://famousfamily2.dnsalias.org/famousfamily/archive?ID=46732

I wanted to be able to achieve backwards support for the old links.

To achieve this, I defined a Redirecting servlet and deployed it as all of the top level folders. So there's a Redirecting servlet deployed as JenMark. When a url like the example above comes in, the Redirecting servlet forwards the request to

http://famousfamily2.dnsalias.org/famousfamily/archive?htmlpath=JenMark/MarksFolders/133_3394.html

The path parameter is the old location.

The archive servlet reads the path and maps that back to the ID in that place.

Eventually this remapping should be removed since links to the static folder path are not immutable anyway. Someone could move the element in their file system, sync up, and then the path is no longer valid.

That is way it is always a good practice to link by ID.

Old links use to also be made to the showelementpage servlet as in the following example.

http://famousfamily2.dnsalias.org/famousfamily/showelementpage?ID=58370

The new servlet takes those links and remaps them to the new format.

http://famousfamily2.dnsalias.org/famousfamily/archive?ID=58370

It was sort of a pain to do all this backwards link mapping, but it's necessary since so many family blogs link into the archive for photos.

No comments:

Post a Comment