Host Laravel in Apache Shared Hosting


Want to host a Laravel application in a shared hosting server, but can’t figure out how to point the domain to the public directory?Put the following in a .htaccess file in the project root which is probably the public_html directory.

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

Leave a Reply

Your email address will not be published. Required fields are marked *