1

Problem: When i access non existing route it shows 404 page except site.com/admin, it shows blank page.

my web.php file,

 Route::group(['prefix' => 'admin', 'middleware'=>'auth:admin'], function () { Route::POST('readnotification','NotificationController@readnotification')->name('readnotification'); Route::GET('/home','AdminController@index')->name('admin.dashboard'); .... 

Full web.php file is here https://pastebin.com/embed_js/pZNmPih8

Tried:

1) I have seen php artisan route:list, /admin route is not exist.

2) I removed all routes, and accessed a non existing route then it shows 404 page, except site.com/admin, as usual it shows blank page.

3) Even i emptied the web.php file, but still /admin is blank and other urls going to 404

I really don't know whats happening.

9
  • Do you have Route::GET('/ inside group ? Commented Mar 24, 2018 at 11:24
  • @C2486, no i have something like this Route::GET('/home','AdminController@index')->name('admin.dashboard'); Commented Mar 24, 2018 at 11:26
  • I think it works if you go to /admin/home ? Right Commented Mar 24, 2018 at 11:31
  • yes, /admin/home works Commented Mar 24, 2018 at 11:32
  • Please post your Nginx / Apache site config Commented Mar 24, 2018 at 16:30

2 Answers 2

1

Make sure you have not created any directory inside public/ as same as your route name. If you have /admin directory inside public/ then your /admin route will not work and show blank page without any error. Anything inside public/ directory will not show as 404 page instead of that it will show a blank page

Sign up to request clarification or add additional context in comments.

Comments

0

As you commented that you have below route to get work if you go to /admin

 Route::get('/home','AdminController@index')->name('admin.dashboard'); 

Then it should be just / inside admin group , or add it as another route to get both route work

 Route::get('/','AdminController@index')->name('admin.dashboard'); 

1 Comment

tried that, and ran php artisan route:clear, still showing blank page

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.