Second attempt at fixing PHP redirect borking.