PHP header redirect not working

前端 未结 13 2085
小蘑菇
小蘑菇 2020-12-05 12:00

I know this has been covered before but I cannot find an answer to this,

I have always used this;

header(\"Location: http://www.website.com/\");
exit         


        
13条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 12:28

    Try removing the Space Between location and the first h in http.

    header("Location: http://www.website.com/");
    exit();
    

    turns into

    header("Location:http://www.website.com/");
    exit();
    

    I had this problem on my WAMP Server.

    Although it shouldn't be the problem, considering that is how it is documented in the PHP documentation. But you should probably try it anyway. I know it has worked for me in a number of cases.

提交回复
热议问题