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

snipesnipes's avatar

How to deploy a laravel website

Hello , im pretty new to laravel 'im following the free Laravel from scratch videos , see I got a virtual server with a cpanel I can use , and I got lots of websites from customers on it ... what is the best way to deploy a Laravel website since I cannot say that public is the root.. I'm sure its simple , someone knows for sure ? thx

0 likes
6 replies
snipesnipes's avatar

I kown and I've seen this too , but the fact is that I dont want to empty my pubic_html folder to install my Laravel there , there is a website in there , I need to install my website built in Laravel in an addon domain , in a folder ..

u see what I mean ? u got an idea?

snipesnipes's avatar

Umm I guess its the only way .. but will it be ok to have a .htaccess like so:

RewriteEngine on RewriteCond %{HTTP_HOST} ^domain-name.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www.domain-name.com$ RewriteCond %{REQUEST_URI} !folder/ RewriteRule (.*) /folder/$1 [L]

to make it redirect to the Laravel public folder?

cookie_good's avatar

snipesnipes

Deployment is different depending on whether your using shared hosting, and it also greatly depends on what webserver software using. It's almost always apache2 or nginx.

You are not going to share a folder with another Website, as you might html site. Laravel needs a virtual host, as stated by previous posters.

Please or to participate in this conversation.