我希望在HTML和Firebase中成功登录或注册后,将用户重定向到另一个页面。
我在主文件夹中有login.html
和signup.html
以及home.html
。
成功登录或注册后,我需要将用户重定向到home.html
,并防止用户返回到login.html
或signup.html
。
使用JavaScript:重定向
window.location = 'mysite';
以HTML形式重定向:
<input type="submit" target="mysite" value="Sign in"/>
在HTML元中重定向:
<meta http-equiv="refresh" content="time; URL=new_url" />
在PHP:中重定向
<?php
header('Location: mysite');
exit;
?>
在Firebase:中重定向
"hosting":{
"/bar""for requests to""/foo""(but not""/foo/**"")""redirects":[
{
"source":"/foo",
"destination":"/bar",
"type":301
}
]
}
在form
内部使用带有目标URL的<input type="submit">
。
这里有一个例子:
<input type="submit" target="mysite.com">Sign in!</input>