DEV Community

Discussion on: Deploying Laravel8 app on shared-hosting (Hostinger)🌎

Collapse
 
felix2056 profile image
Info Comment hidden by post author - thread only visible in this permalink

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:

  1. create a new .htaccess file inside public_html directory
  2. Add these codes
  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]
Enter fullscreen mode Exit fullscreen mode

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.

Collapse
 
bangado profile image
Bangado

Hello I would like to have your help I used your path to deploy my laravel application on hostinger but I have a 403 error

Some comments have been hidden by the post's author - find out more