How to detect additional page paths before redirect

Permalink
I'm trying to build a tool that will allow me to track when a user requests a page at an additional page path instead of the canonical URL. So, for example, if a live page lives here:

http://www.example.com/about


but an additional page path has been set as below to redirect to the above

http://www.example.com/my-redirect


I want to track when someone visits my-redirect BEFORE it redirects to about. To do this, my first hunch was to create an event listener in my application/bootstrap/app.php like so:

Events::addListener('on_before_dispatch', function($event) {
       // check if the requested URL is actually an additional page path
});


However, I'm stumped. I'm not sure if this is the best the way to do this. I've tried different event listeners like on_before_render and on_page_view but the redirect seems to occur BEFORE this event is dispatched. The on_before_dispatch does fire before a redirect, but I have no access to the C5 page object...it's just null.

For example, the below page object is null?? I'm assuming things haven't been initialized yet so this is why it's null...looking for any other alternative to track these redirects...

Events::addListener('on_before_dispatch', function($event) {
       $req = Request::getInstance();
       $currPg = $req->getCurrentPage();  // <---- $currPg is NULL.
});


Thanks!

stephendmalloy