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

magero's avatar

Hosting a laravel app as a subdomain on a wordpress primary site

I have a client's wordpress site running on the primary domain www.domain.com and since we are redesigning i wanted to show the newsite(made with laravel) on a subdomain newsite.domain.com. I have put the laravel app root directory in public_html/smith and placed all the public folder contents in there while the rest are in a folder on the root directorty. When i edit the index.php to point to this folder, it returns an error "The site can't be reached. Can anyone help on how to host a laravel app as a subdomain of a wordpress main website?

0 likes
2 replies
aurawindsurfing's avatar

Try creating a symlink on your linux between root and your project. You should not be able to access files above your project root directory - so that is a correct behaviour.

chask's avatar

inside your public_html folder ,there should be your project folder like test.yourdomainname.com

Please or to participate in this conversation.