How to make default route to be 404 page

Hello all,

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




this route will work when we open with


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




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 -

thank you :) It’s what i want.