I am trying to remove string from url and it removes also and redirects to new url but it giving 404 i.e. page not found.
My route is :
Route::get('singlepage/{slug}',[WebController::class,'web_pages'])->name('web.pages');
url : https://example.com/singlepage/about-us
result url : https://example.com/about-us
I am trying the code,
RewriteEngine On
RewriteRule ^singlepage/(.*)$ /$1 [L,R=301,QSA]
RewriteRule ^singlepage$ / [L,R=301,QSA]
I don’t understand, where I am missing.
Please help me out.