How to make default route to be 404 page

Hello all,

i have changed on my route for homepage, it will look like this:




'rules'=>array(

'/'=>'site/home',

)



this route will work when we open with

or

but in my case i want it only able to ‘/’ route, when it use ‘site/home’ i want it say ‘404’

anyone have idea for it ?

thank you

Have you tried with




'rules'=>array(

''=>'site/home',

)



in my case i do not want to able access default route (site/home)

for example i have some routes:




'routes' => array(

'contact' => 'site/contact',

'categories' => 'site/categories',

),



i WANT to able to access with "contact and categories" only other then will go to 404 page.

current i still able to access with "site/categories and site/contact"

You need to set useStrictParsing to true - http://www.yiiframework.com/doc/api/1.1/CUrlManager#useStrictParsing-detail

thank you :) It’s what i want.