So I am wondering how to handle 403 error thrown by .htaccess. I have disabled directory listing with :
Options -Indexes
but then I get just plain "Access forbidden!" page.
In my global.php I handled 403 error:
App::error(function(Exception $exception, $code) {
Log::error($exception);
switch ( $code ) {
case 403:
return Response::view('errors.403', array(), 403);
...
but it never gets to here. So my question is how do I "catch" 403 error, or should I somehow "throw" it without htaccess?
Thanks
I solved this by adding
ErrorDocument 403 /
in my .htaccess file. It basically redirects 403 errors to base url "/" so it doesn't display any error messages which is acceptable for me.
Hi there, Can you please paste your .htaccess file contents? I'm facing the same issue and unsure on how to proceed.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community