用路由器登录重定向

时间:2019-07-30 15:37:18

标签: php

登录后我无法重定向到我的主页

我的结构:

views/auth/login.php <-- Thats my Login Page
public/index.php/ <-- router
https://sub.mydomain.de/auth/login <-- login url
https://sub.mydomain.de/ <-- url after Login

如果登录名有效,我想将用户重定向到此页面https://sub.mydomain.de/

我尝试过:

header("/../../../public/index.php")

1 个答案:

答案 0 :(得分:1)

一切都很好,但是这里缺少的是Location中的header()

 `header("Location: /../../../public/index.php");`

您必须在标题中定义位置!

学习一些有趣的东西的最佳去处PHP

快乐编码!