Fixing Laravel’s Public Folder Redirect on Cpanel Shared Hosting Installation

  1. Locate the index.php file installed in your root folder by default. It should look similar to this:
<?php
header("refresh: 5; https://yoursite.com/public/");
echo '<title>Laravel Installed</title><div style="background: #e9ffed; border: 1px solid #b0dab7; padding: 15px;" align="center" >
<font size="5" color="#182e7a">Laravel is installed successfully.</font><br /><br />
<font size="4">Laravel is a Framework and doesn\'t have an index page.<br /><br />
You will be redirected to its "public" folder in 5 seconds...<br /><br />
Laravel is a clean and classy framework for PHP web development.
Freeing you from spaghetti code, Laravel helps you create wonderful applications using simple, expressive syntax. Development should be a creative experience that you enjoy, not something that is painful. Enjoy the fresh air.
</font></div>';
?>
<?phpuse Illuminate\Contracts\Http\Kernel;
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));require __DIR__.'/vendor/autoload.php';$app = require_once __DIR__.'/bootstrap/app.php';$kernel = $app->make(Kernel::class);$response = tap($kernel->handle(
$request = Request::capture()
))->send();
$kernel->terminate($request, $response);

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store