Laravel in sub-directory

im trying to upload laravel in sub-directory (static site no database) home page load fine but other pages like about, services throw error Internal Server Error. laravel.log and error_log are empty

its load path currently www.example.com/laravel/about


.htaccess and index.php from public folder have move to root folder www.example.com/laravel
index.php contains:

use Illuminate\Http\Request;

define('LARAVEL_START', microtime(true));

// Determine if the application is in maintenance mode...
if (file_exists($maintenance = __DIR__.'/storage/framework/maintenance.php')) {
    require $maintenance;
}

// Register the Composer autoloader...
require __DIR__.'/vendor/autoload.php';

// Bootstrap Laravel and handle the request...
(require_once __DIR__.'/bootstrap/app.php')
    ->handleRequest(Request::capture());

htaccess contain:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /laravel/    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

env file modify

APP_DEBUG=true
APP_URL=http://www.example.com/laravel
APP_ENV=local (change production also)

# DB_CONNECTION=mysql
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=leeshow
# DB_USERNAME=root
# DB_PASSWORD=

SESSION_DRIVER=array

web.php

Route::get('/', function () {
    return view('home');
})->name('home');

Route::get('/about', function () {
    return view('about');
})->name('about');

views/component/layout.blade.php for menu

<a href="{{ route('about') }}">About</a>

views/about.blade.php

<x-layout>
   <h1>im about page</h1>
</x-layout>  

unable to load any file from resources/views except home.blade.php

redirecting to public worked for now

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.