Answer the question
In order to leave comments, you need to log in
.htaccess for laravel knocked paths?
Added to root .htaccess with
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php
</IfModule>
Answer the question
In order to leave comments, you need to log in
How to run laravel on shared hosting.
1. You upload the public content to the hosting root folder, which opens at the site address.
2. In the same root folder, create another one (for example, you call it laravel)
3. Copy all other files and folders from the project (app, etc.) to the new folder (laravel), except for public .
4. In the root folder of the site, open index.php and change 2 lines with path configs to the following code.
....
require $_SERVER['DOCUMENT_ROOT'].'/laravel/vendor/autoload.php';
....
$app = require_once $_SERVER['DOCUMENT_ROOT'].'/laravel/bootstrap/app.php';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question