It seems there are a lot of different approaches to deploying a laravel application on shared hosting based on some googling. I understand it's different per hosting provider, but I'm looking for a simple and secure way to do this.
Right now I have a symlink from /home/username/laravel-src/public
to /home/username/public_html
. This gets my application on my domain, although under the public route (ie. www.domain-name.com/public
). I can fix this easily by updating my .htaccess
file in my public_html
director to the following:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
I've seen this suggested in other posts, but people are saying this is not a secure approach and I'm wondering why? Isn't this just redirecting requests from /
to /public
internally? None of the src
or env
files are exposed...are they??
And if there are security concerns around this, is there at all a secure way to deploy a laravel app to shared hosting?