remove controller from url (site has multiple controllers)

Hi there,

i have a big problem and maybe somebody here can help me with my problem.

I bought a script and this script has 3 controllers: store / merchant / admin

i want to get rid of the domain_com/store/home that it looks like domain_com/home

so that the default controller is store and is not needed in the url.

for merchant and admin it should stay as it is, just for store i want to get rid of the store controller in url.

So for Example:

Now -> domain_com/store/home

Later -> domain_com/home

Now -> domain_com/merchant/index

Later -> domain_com/merchant/index

Now -> domain_com/admin/index

Later -> domain_com/admin/index

i had to replace the dot in the domain otherwise i was not able to post it here.

Im verry new to yii and i dont know how to set the urlRules for that…

my current rules are:


               '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>',		        

		    ),

		    'showScriptName'=>false,

		),

I have not found a sample for this special case.

I would appreciate any help or hint how to do it

Please its verry important for me to get to a solution

Thank you verry much for your help!

You can set the default controller in the config:




'defaultController' => 'store'



it is already set to


'defaultController' => 'store'

What happens if you try to access "domain_com/home"?

Error 500

Page cannot be displayed

I managed it now for home to be displayed i have now this rules:




                'urlManager'=>array(

		    'urlFormat'=>'path',

		    'rules'=>array(


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

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

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

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

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

		    ),

		    'showScriptName'=>false,

		),

i simply added ‘<action:\w+>’=>‘store/<action>’

this works now for www.url_com/home and other single actions but not for those who have 2x / behind url

like this: www.url_com/menu/merchant/bella-italia there it displays a blank page

If you get an error 500, you should find additional information in your log file. Please post it here.

Already fixxed it by using




$patern="home|checkout|contact|signup"; //and more...

$patern=strtolower($patern);




And then urlmanager





'urlManager'=>array(

			'class' => 'UrlManager',

		    'urlFormat'=>'path',

			'showScriptName'=>false,

		    'rules'=>array(

		        '' => 'store/home',

		        '<action:('.$patern.')>' => 'store/<action>',

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

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

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

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

		    )

		),