Answer the question
In order to leave comments, you need to log in
Why does laravel return 500 error after uploading to hosting?
Good afternoon! Such situation. Uploaded lara to hosting. When the site is opened, the url becomes www.ru/public. I tried to remove this public in htaccess, but it doesn't work. What is the problem?
Below I give htaccess, which lies in the public folder + its copy in the root of the site.
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
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}]
</IfModule>
Answer the question
In order to leave comments, you need to log in
There should not be any .htacess in the root of the site. The site must work from the public folder.
Accordingly, in the hosting settings, the root folder of the server must be public.
The entry point for the site from the root is server.php, not index.php
PS Don't do this, better reconfigure the server to the /public folder
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question