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

1k3r's avatar
Level 6

How to Implement WordPress for Specific Pages in a Laravel Project?

Hi everyone,

I’m currently working on a project using Laravel, with the domain example.com. My goal is to integrate WordPress only for the homepage (example.com) and the "About Us" page (example.com/about-us). The rest of the website’s routes should remain handled by Laravel (e.g., example.com/users would be a Laravel route).

Has anyone done something similar before? How would I go about setting up WordPress for just these two pages while keeping Laravel as the main framework for the rest of the site?

I'm thinking about using a subfolder or perhaps configuring something within the server (like Nginx or Apache), but I'm not sure of the best approach.

I appreciate any help or suggestions. Thanks!

1 like
2 replies
1k3r's avatar
Level 6

@vincent15000

The option that convinces me the most for now is to use landing.example.com as a subdomain for the WordPress landing page. On example.com (laravel app), I’ll render the landing content by making a request with Http::get('https://landing.example.com') from Laravel.

Route::get('/', function () {
   if (auth()->check()) {
      return redirect('/dashboard');
   }

   return Http::get('https://landing.example.com')->body();
});

Since it’s only going to be the landing page and maybe an 'About' page, this keeps things simple while still allowing Laravel to handle redirections for logged-in users. Also, as long as absolute URLs are used in WordPress, assets (CSS, JS, images) will load correctly from landing.example.com.

Thanks for the input

1 like

Please or to participate in this conversation.