# Routes in web.php Not Working After Migrating to Acorn 4 – Looking for Insights

**URL:** https://discourse.roots.io/t/routes-in-web-php-not-working-after-migrating-to-acorn-4-looking-for-insights/28919
**Category:** acorn
**Created:** 2024-11-19T19:46:00Z
**Posts:** 1

## Post 1 by @bantunesm — 2024-11-19T19:46:00Z

Hi everyone,

I couldn’t identify the root cause, but for some reason, routes defined in web.php stop working after migrating to Acorn 4.

Here’s a workaround you can use:

```
add_action('template_redirect', function () {
            $acornRoutes = ['/user-type', '/debug-session'];
            foreach ($acornRoutes as $route) {
                if (strpos($_SERVER['REQUEST_URI'], $route) === 0) {

                    $kernel = app(\Illuminate\Contracts\Http\Kernel::class);
                    $response = $kernel->handle(
                        $request = \Illuminate\Http\Request::capture()
                    );
                    $response->send();
                    $kernel->terminate($request, $response);
                    exit;
                }
            }
        });
```

This snippet ensures the specified routes are handled correctly.

If anyone has an explanation for why this happens, I’d be glad to hear it!
