How To Make Url Seo Friendly


i have created application and it’s ready to go online. but i want to make it SEO friedly. so i have gone through this link but got confused that how to make url

like this?

and once i have url like this i need to Optimize my website or not?

if any other good way to make url SEO friendly then pls suggest me

Thanks in advance

There are a number of Yii extensions that facilitate SEO handling. Search for "SEO" in the extensions section. Good luck.

Hi can you suggest me some extension which is good or you have used in your application…

I haven’t needed one so I haven’t used them. Just go ahead and try a few to find out ;)

This is already built in to Yii.

Create an .htaccess file in your root folder containing the following:

RewriteEngine on

# if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php

RewriteRule . index.php

Uncomment the following in config/main.php or add it in the components section

        'urlManager' => array(

            'showScriptName' => false,

            'urlFormat' => 'path',

            'rules' => array(

                '<controller:\w+>/<id:\d+>' => '<controller>/view',

                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',

                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',



Your URL’s can work like this now:

You can modify the rules accordingly.

More info here: