PHP header [removed] - what are the implications?

前端 未结 5 1988
暖寄归人
暖寄归人 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:06

    Make sure you die() after your redirection, and make sure you do your redirect AS SOON AS POSSIBLE while your script executes. It makes sure that no more database queries (if some) are not wasted for nothing. That's the one tip I can give you

    For search engines, 301 is the best response code

提交回复
热议问题