r/PHPhelp • u/Beginning-Bother4644 • Dec 12 '24
Running two different project on the same domain in a windows server
Hi,
I currently hit a dead end on a project and not sure how to move forward. I have two projects built in php with different versions of the php. And I want to run the projects on a same domain separated by "/" i.e. xyz dot com will show a different project and xyz dot com / abc will show a different project.
Is this by any means possible to do? If yes, help is really appreciated.
2
Upvotes
1
u/colshrapnel Dec 12 '24
Yes it's possible but you should really explain such whims, because, you know, treating XY problems verbatim can have unexpected consequences...
1
u/Vectorial1024 Dec 12 '24
Using Apache?
3
u/yourteam Dec 12 '24
Dockerize the 2 applications so docker images will be built with different PHP versions.
Each docker will expose different ports like 8080 and 8081
Now use a reverse proxy or a tool like portainer community edition to handle the requests and forward /project1 to localhost (or docker image address) 8080 and /project2 to 8081
1
u/Lumethys Dec 12 '24
I suppose you could use an alias for the other php version or directly execute an binary one. Then put Nginx or Apache in front for the routing part.
But i would just use Docker and call it a day
0
u/[deleted] Dec 12 '24
[deleted] — view deleted comment