i using laravel 11
, everything in the project works well, but only two routes in the project not work
(`127.0.0.1:8000/educator` and `127.0.0.1:8000/dashboard`).
and there are no routes similar in the project.
when i try those routes, i got 404, but not the default laravel 404 pagei i got diffrent 404 page.
laravel default 404 page:
404 that i got:
i try the same route with another views and with diffrent controllers and stay not work,
even like this not work:
Route::get('/educator', function () {
return 'This is a test route';
});
Route::get('/', function () {
return view('home.index');
})->name('home');
Route::get('/educator', function () {
return 'This is a test route';
});
Route::get('/dashboard', function () {
return 'This is a test route';
});
/******************************** AUTH ROUTES *******************************/
Route::get('login', [AuthController::class, 'showLogin'])->name('login');
Route::post('login', [AuthController::class, 'login']);
Route::get('register', [AuthController::class, 'showRegistration'])->name('register');
Route::post('register', [AuthController::class, 'register']);
Route::middleware(['auth'])->group(function () {
/******************************** STUDENT ROUTES *******************************/
Route::get('learning', [IndexController::class, 'learning'])->name('learning');
Route::post('logout', [AuthController::class, 'logout'])->name('logout');
/******************************** COURSE ROUTES *******************************/
Route::get('course', [CourseController::class, 'course'])->name('course');
Route::get('course/lecture', [CourseController::class, 'lecture'])->name('lecture');
Route::get('course/lecture/video', [CourseController::class, 'lecture_video'])->name('lecture-video');
Route::get('course/lecture/text', [CourseController::class, 'lecture_text'])->name('lecture-text');
Route::get('course/lecture/resource', [CourseController::class, 'lecture_resource'])->name('lecture-resource');
Route::get('course/lecture/material', [CourseController::class, 'lecture_material'])->name('lecture-material');
Route::get('course/lecture/survey', [CourseController::class, 'lecture_survey'])->name('lecture-survey');
});
.htaccess:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
all routes in my web.php work, except “/educator” and “/dashboard”
i also try diffrent broswers and diffrent servers (laragon and xampp) i tried to the project again, but still not works.
pls is there any one can help me to fix this problem.
Bilal Abdulhadi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
11
There were two files (educator, dashboard) with the same route name in the public folder.
so i rename the folders and clear the cache.
so it works now.
Bilal Abdulhadi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.