Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom 404 error page with same URL

How would one go about enabling a custom 404 page on a 404 request, while retaining the same URL in the address bar instead of it looking something along the lines of http://yourwebsite.com/error.html.

like image 620
Matt Bettiol Avatar asked May 03 '26 11:05

Matt Bettiol


1 Answers

Just add the following line to your htaccess file in your root web directory:

ErrorDocument 404 /404page.html

Then make 404page.html contain whatever text you wish to display to the user.

like image 84
John Conde Avatar answered May 05 '26 02:05

John Conde