Deploying app to shared hosting - .htaccess problem
Hi everyone
I am in need to make the laravel app live on shared hosting and can not use Laravel forge at this time. So I uploaded my app files over ftp to public_html/new/ directory.
when I navigate to site.com/new/public I'm getting 500 error
Put .htaccess inside "public_html/" with below content:
# .htaccess main domain to subdirectory redirect
# Do not change this line.
RewriteEngine on
# Change site.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?site.com$
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/new/public/
# Don't change the following two lines.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /new/public/$1
# Change site.com to be your main domain again.
# Change 'subdirectory' to be the directory you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?site.com$
RewriteRule ^(/)?$ new/public/index.php [L]
in folder "public_html/new/public" keep default .htaccess of Laravel.
--> Now you can try to connect to "site.com" to see the result :)
@Prez Thanks for your input. you are right, I will need to do this, I'm just now trying to make new site working, while I need to preserve old site to be functioning during I'm testing new one. And the old one is located in public_html
thanks everybody for you replies. after struggling with this a couple more days I've convinced the client to leverage Digital Ocean and now this is just great