PHP header [removed] - what are the implications?

前端 未结 5 1984
暖寄归人
暖寄归人 2021-02-01 12:18

I have domain.com. If the user is logged in, it should load automatically domain.com/option-X where X is a predefined choice of the user.

5条回答
  •  攒了一身酷
    2021-02-01 13:04

    The effect of the 301 would be that the search engines will index /option-a instead of /option-x. Which is probably a good thing since /option-x is not reachable for the search index and thus could have a positive effect on the index. Only if you use this wisely ;-)

    After the redirect put exit(); to stop the rest of the script to execute

    header("HTTP/1.1 301 Moved Permanently"); 
    header("Location: /option-a"); 
    exit();
    

提交回复
热议问题