I deploy basic Laravel project to server. When I hit my domain it returns default welcome view. When I add simple road (see below) to code and try to enter that route in browser it returns 500 internal error. All routes return 500 error except the "/" root route.
Folder structure:
/
#laravel
#subdoms
##api
Laravel files are in laravel directory except files from public directory which are in api diretory.
.htaccess file in api directory:
<IfModule mod_rewrite.c>
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>
Storage directory and everything in it is writeable, readable, executable for anyone.
There are no error logs in laravel/storage/logs.
laravel/routes/web.php:
<?php
Route::get('/', function () { // works fine.
return view('welcome');
});
Route::get('hello', function () { // 500 internal error
return 'Hello world';
});
Server info:
Server - Linux CentOS - Apache 2.2 - Server Side Includes - SSI - PHP Version 7.0.17
users/
(not in theRoute::group()
section) that does not use/users/
– brianforan