Laravel Create Custom 404 Error Page in Apache

Laravel Create Custom 404 Error Page in Apache

In this Post We Will Explain About is Laravel Create Custom 404 Error Page in Apache With Example and Demo.Welcome on – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to How to create custom 404 page in laravel Example

In this post we will show you Best way to implement Laravel 5.5 – create custom 404 error page, hear for Laravel 5.4 Create 404 Page Not Found HTTP Custom Error Exception with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Also Read :   PHP Mysqli Connect To Database Example

step : 1 Make new laravel project

first of all simple create new Laravel Project

composer create-project --prefer-dist laravel/laravel customlpage

step : 3 app/Exceptions/Handler.php

change some source code in app/Exceptions/Handler.php file below

//How to create custom 404 page in laravel
public function render($request, Exception $exception)
	//check switch case if page found or not
        switch ($exception->getStatusCode()) 
            //Laravel not found
            case 404:
            return redirect()->route('notfound');

            //Laravel internal error
            case '500':
            return redirect()->route('notfound');

                return $this->renderHttpException($e);
            return parent::render($request, $exception);

step : 3 Make Laravel route

make Laravel route for page 404 not found

// How to create custom 404 page in laravel route
Route::get('laravelPageNotAny', ['as' => 'notfound', 'uses' => 'ContactController@laravelPageNotAny']);

step : 4 Make Laravel Controller

simple Make laravelPageNotAny() in ContactController

Also Read :   parse_str to Get Query String from URL in PHP

How to create custom 404 page in laravel view HTML
public function laravelPageNotAny()
    return view('errors.laravelPageNotAny');

step : 5 create 404 page in resources/views/errors folder

make Laravel simple HTML source code 404 page in resources/views/errors in this path folder

<!DOCTYPE html>
	<title>YOUR- Website name : Page Not Found</title>
	<h1>Sorry, :( Page Not Found</h1>

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example


I hope you have Got What is Laravel 5 custom error view for 404 And how it works.I would Like to have FeedBack From My Blog( readers.Your Valuable FeedBack,Any Question,or any Comments about This Article( Are Most Always Welcome.