php – How to have multiple subdomains resolve the same in Laravel


I’m using the latest Laravel framework and I’m trying to point 2 URLs to the same code base. For instance, I have app.example.com working fine and I want app1.example.com to do the same.

I have all my DNS routing and everything working fine. However, when I reach the public index page using app1.example.com, I get a 404, not the index page as I’m expecting.

I suspect it has something to do w/ my app.php’s ‘url’ value, which is currently set to app.example.com. However, looking through the codebase, I’m not seeing anything in routes that would make me get the 404 based off this URL. Maybe it’s because of the magic in the base framework?

I could make the ‘url’ value variable and just pick up the current URL. I’m not sure if that’s truly the problem though or if that would cause other issues down the road.

Any thoughts would be appreciated.



Source link

Leave a Comment