0

At first sorry for my poor English. I want to handle all requests which do not match with my routes to CustomPageController.

I am trying to configure my module.config.php like this:

'defaults' => array(
                    'type' => 'Zend\Mvc\Router\Http\Literal',
                    'options' => array(
                        'route' => '/*', // or 'route' => '/user*' for example, to handling www.site.com/user4 (just as example)
                        'defaults' => array(
                            'controller' => 'custom_page',
                            'action' => 'index',
                        ),
                    ),
                ),

To handle all queries that do not match with routes must redirect to my last "defaults" route. But it is not working.

Christian Stewart
  • 15,217
  • 20
  • 82
  • 139
Nikoole
  • 4,553
  • 4
  • 18
  • 23

1 Answers1

0

You can use your ErrorController as an alternative for this. If the controller name is not found then you get the error code 500. You can then do whatever you want to do on that controller (re-route to your CustomPageController)