Hello,
I believe that it can be done at the Server level by creating a rule that sends the '/blog' route to the desired path in the server or another domain.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have two laravel installations. One is the main app on www.example.com that also allows users login. Then a blog.example.com that doesn't have any users but eventually I would like to share the sessions. There is plenty of material on the topic. The problem I am trying to solve is how to use blog.example.com as www.example.com/blog. Someone suggested AWS Cloudfront but I haven't been able to locate an documentation on it. Any suggestions?
I tried ProxyPass and Middleware. But neither worked. ProxyPass rerouted to right location but I was never able to render the subdomain instance of laravel. it was always a 404 page. For now I went with the following:
This allows me to keep my main app and blog code, routes and db separate for now. Once I can afford to hire someone I would probably go back to solve my original problem via ProxyPass or Cloudfont.
Thanks @imrodrigoalves for your initial help.
Please or to participate in this conversation.