How can I upload my local Laravel web project to the server?

I am working on a website that I made from Laravel and now I need to push it to the server and go live. I am new to Laravel hosting. I used to do coding in pure php and in those days I just push the project to the server and it works. My server is one.com and this is what I get when I copy my content and try to access the page.

enter image description here

Please help me this way! thank

+3


source to share


2 answers


Option 1: use .htaccess

if it doesn't already exist create a .htaccess file in your Laravel root directory. Create a .htaccess file in your Laravel root directory if it doesn't already exist. (This is usually located in the public_html folder) Edit your .htaccess file to contain the following code:



<IfModule mod_rewrite.c>
   RewriteEngine On 
   RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

      

+2


source


Laravel has an entry point (it's a file index.php

). This file is located inside the folder public

. To go LIVE with a Laravel project, you must set the Document Root to a directory public

.

Right now, you can only access your site by following the link: http://van.lesthi.com/public/



At the time of writing; accessing the above url is throwing a SQL error that you might want to fix first.

+2


source







All Articles