B
B
BuBux2019-04-23 16:19:42
Apache HTTP Server
BuBux, 2019-04-23 16:19:42

How to host a Laravel website?

When transferring a site written in Laravel version 5.8 to hosting, the code content of index.php is displayed. At the root of the site, the .htaccess content is:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

in public/.htaccess:
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>
    RewriteEngine On
    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

What could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
leni_m, 2019-04-23
@BuBux

php not configured on hosting

B
BuBux, 2019-04-24
@BuBux

Thanks to all. When creating a domain, I did not specify PHP support. This was the crutch..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question