I'm trying deploy my project to Hostinger with git, but I can't deploy direct to root folder (/home/uXXXXXXXX). The path in cPanel is directly to /home/uXXXXXXX/public_html.
Is there anyway to deploy to root folder? My project is in Laravel. What is the best way to deploy to shared host? Because part of the folders need to be in the root and others in /public_html. Will I have always move folders manualy in my hosting?
I'm a little confused in this part. I'll appreciate any help
The other answers might work but there's no way am complicating something so basic.
What if you have the website working locally in a public
folder rather than public_html
and then you have to make changes to your local branch and re-deploy to git? You'll face errors when your local branch is not in sync with your remote branch.
The best way to do is:
.htaccess
file inside public_html directory RewriteCond %{HTTP_HOST} ^your-domain.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.your-domain.com$
RewriteCond %{REQUEST_URI} !your-laravel-folder/public/
RewriteRule (.*) /your-laravel-folder/public/$1 [L]
In the above lines you should replace the following:
your-domain.com
– Type your own domain name and also replace your-laravel-folder
with your folder name.
you can actually clone it using ssh access.
open ur ssh for a particular domain. go to the root folder. u can clone it there.
you can keep your project files there. even though u have top copy the contents of puclic folder inside your laravel project to public_html folder, and also edit the index.php so that all resources must be pointed to the project folder outside public_html
Inorder to update your project you will have to clone it from ssh again
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With