I am suppressing php errors from front end through .htaccess in WordPress. I want to hide the errors throwing 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 throwing a 500 internal server error. I tried
error_reporting(0);
ini_set('display_errors', 0);
in the header.php file, no change. Is there any way to redirect to homepage if a 500 error occurred?