# I'm getting a Laminas generated 404 error. Can anyone help?

**URL:** <https://discourse.laminas.dev/t/im-getting-a-laminas-generated-404-error-can-anyone-help/1833>\
**Category:** Components & MVC\
**Tags:** laminas-mvc\
**Created:** [September 18, 2020, 5:39pm UTC](https://discourse.laminas.dev/t/im-getting-a-laminas-generated-404-error-can-anyone-help/1833 "2020-09-18T17:39:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farsideman](https://avatars.discourse-cdn.com/v4/letter/f/5f9b8f/32.png) [@Farsideman](https://discourse.laminas.dev/u/Farsideman)\
**Post date:** [September 18, 2020, 5:39pm UTC](https://discourse.laminas.dev/t/im-getting-a-laminas-generated-404-error-can-anyone-help/1833/1 "2020-09-18T17:39:00Z")

</div>

The error is as follows:

# A 404 error occurred

## Page not found.

The requested URL could not be matched by routing.

### No Exception available

I’ve registered the module and namespace with composer. The requested url is [http://laminas.com/index](http://laminas.com/index). I’m using XAMPP on Window 10. My code is as follows:

module\Album\config\module.config.php

```
<?php

declare(strict_types=1);

namespace Album;

use Laminas\Router\Http\Segment;
use Laminas\ServiceManager\Factory\InvokableFactory;

return [
	'router' => [
        'routes' => [
            'album' => [
                'type' => Segment::class,
                'options' => [
                    'route' => '/album[/:action[/:id]]',
                    'constraints' => [
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
                        'id' => '[0-9]+',
                    ],
                    'defaults' => [
                        'controller' => Controller\AlbumController::class,
                        'action' => 'index',
                    ],
                ],
            ],
        ],
    ],
    'controllers' => [
        'factories' => [
            Controller\AlbumController::class => InvokableFactory::class,
        ],
    ],
    'view_manager' => [
        'template_map' => [
            'album/index' => __DIR__. '/../view/album/album/index.phtml',
        ],
        'template_path_stack' => [
            'album' => __DIR__. '/../view',
        ],
    ],
];

```

module\Album\src\Module.php

```
<?php

declare(strict_types=1);

namespace Album;

class Module
{
	public function getConfig() : array
    {
        return include __DIR__. '/../config/module.config.php';
    }
}

```

module\Album\src\Controller\AlbumController.php

```
<?php

declare(strict_types=1);

namespace Album\Controller;

use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\ViewModel;

class AlbumController extends AbstractActionController
{
	public function indexAction()
	{
		return new ViewModel();
	}
}

```

module\Album\view\album\album\index.phtml

```
Index page displays here...

```

---

<div class="post-metadata">

**Author:** ![Farsideman](https://avatars.discourse-cdn.com/v4/letter/f/5f9b8f/32.png) [@Farsideman](https://discourse.laminas.dev/u/Farsideman)\
**Post date:** [September 18, 2020, 5:51pm UTC](https://discourse.laminas.dev/t/im-getting-a-laminas-generated-404-error-can-anyone-help/1833/2 "2020-09-18T17:51:01Z")

</div>

My mistake I figured this out.

---

<div class="post-metadata">

**Author:** ![sandeep943](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/sandeep943/32/1516_2.png) [@sandeep943](https://discourse.laminas.dev/u/sandeep943)\
**Post date:** [June 7, 2023, 10:25am UTC](https://discourse.laminas.dev/t/im-getting-a-laminas-generated-404-error-can-anyone-help/1833/3 "2023-06-07T10:25:30Z")

</div>

Can you please share the solution. I am also facing the same error

---

<div class="post-metadata">

**Author:** ![ALTAMASH80](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/altamash80/32/895_2.png) [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Post date:** [June 8, 2023, 10:25am UTC](https://discourse.laminas.dev/t/im-getting-a-laminas-generated-404-error-can-anyone-help/1833/4 "2023-06-08T10:25:38Z")

</div>

This is a very interesting question indeed. You(@Farsideman) were able to redirect [Laminas.com](http://Laminas.com) to your laptop or desktop? For anyone who can’t see any error or exception in Lamins MVC application, he/she should check if display\_error is on in his/her Apache configuration. If that is the case then he/she should check the application config file display\_exception configuration. If it is false then Laminas will not show any exception detail.

Secondly, the route which is mentioned here has nothing to do with the Album route, because according to the default configuration of the Laminas MVC, the index route is mapped to the application index controller index action. I hope it helps. Thanks!
