Redirect in PHP not working

is generally enough to redirect your page but most of the time it does not work because it requires that no data should be sent to the client before the header, or rather header should be the first thing sent to the client. To fix that problem using PHP Buffering

Note that in some case even this might not work. The reason is likely something was already sent to the client before the header. Typical example would be an add-in in the browser which injects some javascript into the page. If that is the case, redirect will not occur. In that you give the user an option to manually redirect, like this

To better trouble shoot this problem, see page contents and you will like see something that has been spitted out. In my case it was

The problem was only in Safari probably because of extension. In Firefox the redirect was working fine.

Leave a Reply

Your email address will not be published. Required fields are marked *