Hi guys,
my solution for this is adding this route in bootstrap:
$front->getRouter()->addRoute('indexFix', new
Zend_Controller_Router_Route(':action',
array('module'=>'default','controller'=>'index','action'=>'')));
The only point thats not that cool, is that you cannot call any other
controller just by it's controller name - you'll have to specify an action
to access these. For example /users/search will work, just "/users" won't,
because it will call IndexController::usersAction ;)
David Mintz-3 wrote:
>
> On Sun, Oct 19, 2008 at 9:31 AM, till <[EMAIL PROTECTED]> wrote:
>
>> On Sun, Oct 19, 2008 at 7:25 AM, TimTowdi <[EMAIL PROTECTED]> wrote:
>> >
>> > I want all actions for my IndexController to work using only the action
>> name,
>> > and actually redirecting if the index controller name is used. So:
>> > http://example.com/index/sitemap/
>> > Would actually issue a redirect to:
>> > http://example.com/sitemap/
>> >
>> >
>> > However, I will have other controllers, and I want them to use both
>> > controller and action, so for the indexAction of AdminController:
>> > http://example.com/admin/
>> > And for the loginAction of AdminController:
>> > http://example.com/admin/login/
>> >
>> > How would this best be accomplished?
>>
>> Don't hold me responsible for typos, but ...
>>
>> $router->addRoute('sitemap',
>> new Zend_Controller_Router_Route('/sitemap',
>> array('controller' => 'index', 'action' => 'sitemap', 'module' =>
>> 'default')));
>>
>> That should go in your bootstrap, whereever you setup your routes.
>
>
>
> I think he wants to know one routing recipe whereby all the actions in his
> index controller can be accessed as example.org/action instead of
> example.org/index/action. I have wondered the same thing but was afraid to
> ask :-) Though I could image an intelligent 404 handler but that doesn't
> seem the most efficient solution.
>
>
>
> --
> David Mintz
> http://davidmintz.org/
>
> The subtle source is clear and bright
> The tributary streams flow through the darkness
>
>
--
View this message in context:
http://www.nabble.com/Routing-so-that-%27index%27-never-shows-up-in-the-url--tp20053411p20081102.html
Sent from the Zend Framework mailing list archive at Nabble.com.