When I test my CodeIgniter redirect code, the following error occurs:
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /var/www/allci/CIone/application/config/autoload.php:1)
Filename: helpers/url_helper.php
Line Number: 544
What is causing this?
Output started at (as the error says)
/var/www/allci/CIone/application/config/autoload.php on line 1. This means that either autoload.php is a mixed HTML/PHP file (which it probably shouldn’t be) or, more likely, autoload.php is has leading white space before it’s opening<?phptag.The
<should be the first byte in the file – you need to make sure there are no spaces, tabs, carriage returns etc at the start of the file. You also need to make sure the file does not have a BOM at the start of it.