.htaccess and index.php from public folder have move to root folder
I suggest you correctly setup the folder structure and point to public as the document root.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
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
.htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /laravel/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
index.php: 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());
config/app.php 'url' => env('APP_URL', 'http://www.example.com/laravel'),
env file APP_DEBUG=true APP_URL=http://www.example.com/laravel APP_ENV=local (change production also)
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: About
Home page loads fine but about and other pages show Internal Server Error as laravel.log and error_log are empty
Please or to participate in this conversation.