hawkiq
1 week ago
167
8
Laravel

The GET method is not supported for this route. Supported methods: HEAD.

Posted 1 week ago by hawkiq

This like the first time i face such a problem, I use Laravel for quite time , I faced this problem when Upgraded to Laravel 8, I've created new project did my work as usual uploaded to shared hosting then i got this error The GET method is not supported for this route. Supported methods: HEAD. this error appears only in root URL "/" any other routes works fine. here is an example https://osama.app/masarat show an error but this URL https://osama.app/masarat/index , works as required so what is wrong with "/" URL

route file web.php

<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', [App\Http\Controllers\PagesController::class, 'index'])->name('index');
Route::get('/index', [App\Http\Controllers\PagesController::class, 'index'])->name('index2');
Auth::routes();

Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');

its works OK on local server

Please sign in or create an account to participate in this conversation.