Giacomo79
(Kylnas)
1
Hi everybody,
I would like to delete the "site" string from the url. I tried with this rule:
'<action:.*>'=>'site/<action>'
It works until I call the “site” actions. When I call an action of another controller, it doesn’t work anymore.
If I use this code:
$this->createAbsoluteUrl('secondcontroller/action')
the framework process the request like if the "secondcontroller" was an "action" of the "site" controller.
How can I solve?
Thanks.
dckurushin
(Diavolonok)
3
by writing ‘<action:.*>’ all requests will go to site controller
The right way would be <action:(index|login|logout)> etc.
mdomba
(Maurizio Domba Cerin)
4
If that rule above is the only one you have… then all your links will use that rule to make the URL…
So for other controllers you need to add some rules…
Giacomo79
(Kylnas)
5
Thanks for the reply, I solve using these rules:
'secondcontroller/<action:.*>'=>'secondcontroller/<action>',
'<action:.*>'=>'site/<action>',
anyway I sould add rule for all new controllers.
dckurushin
(Diavolonok)
6
you have so many actions you cant list them (link in my example above)?
to many route rules is bad
Giacomo79
(Kylnas)
7
I don’t have so many actions, it’s another solution. Actually I use yours. Thanks.