I am suppressing PHP errors from the front-end through .htaccess
in WordPress. I want to hide the errors thrown by WordPress if we are trying to access a file through folder structure:
eg: www.my_site/wp-content/themes/twentyeleven/sidebar-page.php
.htaccess snippet:
php_flag display_errors off
But, it is showing a 500 internal server error. I've tried
error_reporting(0);
ini_set('display_errors', 0);
in the header.php file, no change. Is there any way to redirect to the homepage if a 500 error occurs?