Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何阻止对一个页面的访问并重定向到另一个页面_Html_Redirect_Restriction - Fatal编程技术网

Html 如何阻止对一个页面的访问并重定向到另一个页面

Html 如何阻止对一个页面的访问并重定向到另一个页面,html,redirect,restriction,Html,Redirect,Restriction,嗯。这是我想做的 假设我有三个页面:page1.html,page2.html和page3.html 我想将对page2.html的访问限制为上一页为page1.html的用户换句话说,如果访问者试图从page1.html以外的任何url访问page2.html,我想立即将他们重定向到page3.html 我该怎么做,我该把代码放在哪里?我试着在网上查找信息,但我从来没有找到任何简单直接的答案 你能帮我吗?你可以使用 它使您更改当前的URL。试着把这个放到page2.html: <!doc

嗯。这是我想做的

假设我有三个页面:
page1.html
page2.html
page3.html

我想将对
page2.html
的访问限制为上一页为
page1.html
的用户
换句话说,如果访问者试图从
page1.html
以外的任何url访问
page2.html
,我想立即将他们重定向到
page3.html

我该怎么做,我该把代码放在哪里?我试着在网上查找信息,但我从来没有找到任何简单直接的答案

你能帮我吗?

你可以使用

它使您更改当前的URL。试着把这个放到
page2.html

<!doctype html>
<html>
<head>
<meta http-equiv="refresh" content="0.1; url = page3.html" />
</head>
</html>

content
中,第一个数字表示重定向前要等待多长时间。您可以将其设置为5秒钟,并添加一条消息,说明
拒绝访问,在5秒钟内重定向

您可以使用

它使您更改当前的URL。试着把这个放到
page2.html

<!doctype html>
<html>
<head>
<meta http-equiv="refresh" content="0.1; url = page3.html" />
</head>
</html>


content
中,第一个数字表示重定向前要等待多长时间。您可以将其设置为5秒钟,然后添加一条消息,说明
拒绝访问,并在5秒钟内重定向

欢迎使用SO。请每个问题只回答一个问题/主题。欢迎访问SO。请每个问题只回答一个问题/主题。太好了。这解释了如何重定向,但让我详细说明我真正想做什么。我想拒绝那些试图访问page2.html而不是page1.html的人访问page2.html。换句话说,page1.html应该是访问page2.html的唯一网关。如果它们不是来自page1.html,我希望它跳到page3.html。那怎么办?太好了。这解释了如何重定向,但让我详细说明我真正想做什么。我想拒绝那些试图访问page2.html而不是page1.html的人访问page2.html。换句话说,page1.html应该是访问page2.html的唯一网关。如果它们不是来自page1.html,我希望它跳到page3.html。然后呢?