EZP-23364: fix redirection logic

Fix EZP-23337

(cherry picked from commit 98af00e10af3494852f7db5decc48c36f9561510)

Added changes from suggestions.

(cherry picked from commit a3e47af7f761fcc54c096062fe6b0cf37a4228fa)

Use same check as in UrlAliasGenerator

(cherry picked from commit aad6920a588a47ffab53fac98305601990c93259)

Expose rootLocationId in UrlAliasGenerator for use in UrlAliasRouter

(cherry picked from commit dfd28616ac36006e04adad2b5d65b3be22fc628d)
EZP-23364: additional fixes and tests
Merge pull request #1006 from ezsystems/fix-EZP-23364-pathprefix-redirect

Fix EZP-23364: case-correction redirects with tree_root setting