Custom login

My site index.php has this code at the top of the page...

<?php

if (elgg_is_logged_in()) forward('/activity/');

?>

and it works well.

I have created a custom login page using a plugin called smartlogin whose index.php file has this code at the start of the file...

<?php

if (elgg_is_logged_in()) forward('/smartmenu/');

?>

When I use the mysite.com/smartlogin/ to login to my site it still takes me to the activity page but I want it to take me to mysite.com/smartmenu/.

So, without changing my site index.php, how do I make my smartlogin plugin become smart? :)