Solution :
People who are new to codeigniter often face this issue. Few of the Host Providers have tendency to use the PHP header(); to redirect the Site, So for those kind of specific servers if we are using the PHP header() then it will show us above error. In the Code Igniter the redirect(); function is using the PHP header() to redirect the URL. So this is the reason behind our error.
The only solution on the error is to use the JavaScript to Solve this Issue, I have used it and it works for me as shown below.
//Normal Code to redirect
redirect('site/function1');
//Alternate Code to fix this issue
$myurl = 'site/function1';
echo'
<script>
window.location.href = "'.base_url().'index.php?/'.$myurl.'";
</script>
Hope this solution helps you too.