如何自动将网页重定向到另一个 URL?
htmlweb developmentfront end technology更新于 2025/3/27 12:28:17
页面重定向是指您点击某个 URL 到达页面 X,但在页面内部却被定向到另一个页面 Y。这种情况是由于页面重定向造成的。
要从 HTML 页面重定向,请使用 META 标签。为此,请使用 http-equiv 属性为 content 属性的值提供 HTTP 标头。content 的值是秒数;您希望页面在此之后重定向。
如果您希望页面立即加载新的 URL,请将 content 属性设置为 0。

示例
以下是 3 秒后将当前页面重定向到另一个网站的示例。
<!DOCTYPE html> <html> <head> <title>HTML Meta Tag</title> <meta http-equiv = "refresh" content = "3; url = https://www.qries.com" /> </head> <body> <p>Redirecting to another URL</p> </body> </html>
相关文章
有用资源
html 参考教程 - 该教程包含有关 html 的更多信息:https://www.cainiaomax.com/html/

