Yes this would normally work if you would go to some url that doesn't exist at all!. However you're talking to a PHP application. It can only throw a 404 whenever PHP has run, you can't do it before that. Also the current rewrite rule always points to index.php which will handle the routing for you!
So you have two options here: You need to whitelist all your routes in the htaccess file as well so you can then decide if you want to go to PHP or if you want to go to your custom html page.
Or you do the custom 404 page handling part by Laravel. If you create the resources/views/errors/404.blade.php file you can put anything you want in there ;)
Hi,
Thanks for your answer.
In fact, I don't want to use the laravel exceptions.
Our web server receives a lot of wrong urls, so my idea is to catch the 404 before calling to index.php.
This is because for every request, a phppfm worker is called and this uses lot of ressources (60% cpu).