0

My Laravel server Ip is 192.168.1.250. It is running Centos7, apache web server and php 7. I also added DocumentRoot /var/www/html/vls/public to httpd.conf to redirect requests to Laravel public folder.

Accessing this ip from browser when I have the following code in routs/web.php return error.

Route::get('/', function () {
    return view('welcome');
});

returns:

This page isn’t working 192.168.1.250 is currently unable to handle this request. HTTP ERROR 500

But this route returns 'Hello':

Route::get('/', function () {
    return 'Hello';
});

I tried chmod 777 on app directory, resources directory, views directory and even welcome.blade.php file. Still not working. By the way everything works fine when using php artisan server command. I'm a bit confused what is going on. Any help is appreciated in advance.

.htaccess file content inside public directory.

<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>
Beginner
  • 1,010
  • 4
  • 20
  • 42

0 Answers0