the best way to debug a problem like this is to use the debugging facilities of your browser ... such as the Firebug plugin, or turning on the developer menu in others ... and use it to
exactly what is being sent and received when you go somewhere that achieves a successful redirect. Then, look at your own site and compare the two.