微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

想要将我的HTML页面重定向到网站首页

如何解决想要将我的HTML页面重定向到网站首页

我已经为我的WordPress网站主页创建了一个HTML页面,现在我想将该HTML页面重定向到我的网站主页。 该页面已经上传到我的wordpress文件夹根目录

解决方法

如果您打算从new.html页重定向到wordpress index.php文件:

使用PHP重定向:

header('Location: http://www.example.com/');

使用HTML Meta重定向:

<meta http-equiv = "refresh" content = "2; url = https://www.example.com" />

使用Javascript重定向:

window.location.href = "http://www.example.com";
window.location.replace("http://www.example.com");
,

只需使用meta refresh属性即可重定向到其他站点。

(content =“ 0;将立即进行重定向。)

<meta http-equiv="refresh" content="0;url=http://example.com/" />
,

将以下代码添加到html页面元标记中,以重定向到您的网站

    <head>
       <meta http-equiv = "refresh" content = "1; url = https://www.yoursite.com" />
</head>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。