G
G
GaserV2016-11-01 16:25:50
Laravel
GaserV, 2016-11-01 16:25:50

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>

Z.Y. Removed the rule for the folder, because the site does not fumble at all

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andrey Novikov, 2016-11-02
@Novikofff

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.

A
Andrzej Wielski, 2016-11-01
@wielski

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

G
GaserV, 2016-11-02
@GaserV

Renamed server.php to index.php. All without changes. Added to htaccess, which is in public RewriteRule ^(.*)$ public/$1 [L] and now the site doesn't seem to work at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question