samedi 10 février 2018

Deploying laravel 5.4 project in shared host

I‘m facing some problems with my laravel 5.4 project. I’ve created my project on localhost everyting is working, no problems. Now i need this project to work on shared host. So, I rent a server, create database, create a folder in the same level as public_html, upload all files and folders (except public folder and its content) in this folder. Public folder content i put in publi_html folder. I also make changes in my index.php file in public folder and changed two lines: require DIR.'/../my_folder/bootstrap/autoload.php'; $app = require_once DIR.'/../my_folder/bootstrap/app.php';

In .env file besides database connection lines, I’ve also changed line DB_HOST=127.0.0.1 to DB_HOST=localhost

When i try to run my project on shared host, the starting page works perfect, but when i try to navigate to other pages, i‘m getting error connecting with routes (NotFoundHttpException in RouteCollection.php)

My .httacces file content is:

Options -MultiViews RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule . - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Maybe i need some changes here? I really appreciate any help.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire