Reputation: 191
I developed Laravel 11 website. I have subdomain for admin panel this is my routes/web.php file:
Route::domain('admin.domain')->name('admin.')->group( function () {
Route::get('/', 'index')->name('login.index');
Route::get('/login', 'index')->name('login.show');
});
On my localhost all works fine, but when I uploaded my project to cpanel and entering / it shows the login page as expected but /login returns 404 not found error of server not 404 of laravel. this is how I uploaded my website to cpanel:
<?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());
to
<?php
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));
// Determine if the application is in maintenance mode...
if (file_exists($maintenance = __DIR__.'/../web_files/storage/framework/maintenance.php')) {
require $maintenance;
}
// Register the Composer autoloader...
require __DIR__.'/../web_files/vendor/autoload.php';
// Bootstrap Laravel and handle the request...
(require_once __DIR__.'/../web_files/bootstrap/app.php')
->handleRequest(Request::capture());
Upvotes: 1
Views: 121
Reputation: 191
well, I figured out the problem. It was because I forgot to upload .htaccess
Upvotes: 1