CHtml Link

I am creating a link around an image like this:

$referralImg = CHtml::image("/images/btn-referral.png", "Submit a Referral", array('id'=>'referral_img')); 

echo CHtml::link($referralImg, array("user/login"));

This image is on the top of every page. When I am on my index page and I click the button I get redirected to (Which is what I want it to do)

But when I am on that page and click on the same button I get redirected to

I don’t understand why the link is being created like that.

Here are my url rules


                'admin' => 'admin/default',








Thanks for any help




Perfect, Thanks.