Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ethar's avatar
Level 5

redirect api route to subdomain

i make editing in existing projects, old project work in a subdomain, and new project work in the main domain, I want when any request with prefix api to redirect to a subdomain,

in the main domain in RouteServiceProvider i add a redirect to the subdomain but not working, any idea to solve this problem

        $this->routes(function () {
            Route::middleware('api')
                ->prefix('api')
                ->domain('eht.qurra.com')
                ->group(base_path('routes/api.php'))
0 likes
1 reply

Please or to participate in this conversation.