-->

如何在PHP中进行重定向?

2020-04-08 07:09发布

问题:

Is it possible to redirect a user to a different page through the use of PHP? 是否可以通过使用PHP将用户重定向到其他页面?

Say the user goes to www.example.com/page.php and I want to redirect them to www.example.com/index.php , how would I do so without the use of a meta refresh? 假设用户转到www.example.com/page.php并且我想将其重定向到www.example.com/index.php ,那么在不使用元刷新的情况下该怎么做? Is it possible? 可能吗?

This could even protect my pages from unauthorized users. 这甚至可以保护我的页面免受未经授权的用户的侵害。


解决方案:

参考一: https://stackoom.com/question/3Du3/如何在PHP中进行重定向
参考二: https://oldbug.net/q/3Du3/How-do-I-make-a-redirect-in-PHP
标签: