mardi 14 novembre 2017

How to correctly set Laravel Directory in a hosting

So, I have uploaded my Laravel project in my hosting, I placed the DocumentRoot of Apache to be in my project/public folder.

If I visit my URL it shows the home page without any problem. But if I try to visit any other page it gives me

The requested URL /help was not found on this server.

I think there is some problem with re-direct and all. It works nicely in my localhost though, I am uploading the exact same localhost copy to my hosting.

How can I resolve this issue? I am using DigitalOcean as a server.

My index.php has these two lines

require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';

.htaccess file

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    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>



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2hsLsrV
via IFTTT

Aucun commentaire:

Enregistrer un commentaire