简体   繁体   中英

Url Re-Writing with YII

I am trying to use the YII for URL Re-Writing. Is there any way to show the page extensions like .html or .php? Please help I am new in YII.

Use urlSuffix parameter

array(
    ......
    'components'=>array(
        ......
        'urlManager'=>array(
            'urlFormat'=>'path',
            'rules'=>array(
                'pattern1'=>'route1',
                'pattern2'=>'route2',
                'pattern3'=>'route3',
            ),
            'urlSuffix' => '.html'
        ),
    ),
);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM