如何在Yii框架的路由规则中添加到静态页面的链接


How to add link to a static page in Yii framework in routing rules?

我有我的路由规则

'components'=>array(
    /*'urlManager'=>array(
        'urlFormat'=>'path',            
    ),*/
    'urlManager'=>array(
        'urlFormat'=>'path',
        'rules'=>array(  
            '<controller:'w+>/<id:'d+>'=>'<controller>/view',
            '<controller:'w+>'=>'<controller>/index',
            '<controller:'w+>/<action:'w+>/<id:'d+>'=>'<controller>/<action>',
            '<controller:'w+>/<action:'w+>'=>'<controller>/<action>'

        )

现在我想有一个img在我的页面链接到一个静态网页如:

<a href="www.example.com"><img></a>

但是这个链接重定向到

 www.example.com/example.com

我应该添加什么规则,以便只在此链接上重定向到静态页面

和我的站点基础是www.example.com

所以Yii生成的任何链接总是

www.example.com/"something"

使用CHtml (Recommended by Everyone)

echo CHtml::link('Yii External Link', "http://www.example.com");

<a href="http://www.example.com"><img></a>