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

Devmaurice's avatar

Hosting app to an existing domain

I want to host an app i have myproject to a subroute of an existing domain.

www.mysite.com/myproject . Now when you go to this link(www.mysite.com/myproject) it will use the route with the routes in myproject folder. Am not mapping to the root folder(WWW)

0 likes
1 reply
ctroms's avatar

You can put your Laravel project anywhere you want, preferably somewhere outside of your web directory, and create a symlink in your web directory called myproject that points to the public directory in your laravel project. As long as your web server is configured to follow symlinks, this should work. I'm not sure how clear that was so here is an example.

Assume your project is called laravelproject and your web directory is in /home/useraccount/public_html. Your directory structure would be:

/home/useraccount/laravelproject
/home/useraccount/public_html

Create the symlink in public_html named myproject and symlink to /home/useraccount/laravelproject/public.

myproject -> /home/useraccount/laravelproject/public

Now in the browser you can go to www.mysite.com/myproject and you will be accessing your Laravel project.

Please or to participate in this conversation.