Legacy url redirect handle deep hierarchy. fix #2.

The last page name in the path is extracted and used in the legacy
handler now.