【问题标题】:Want to Redirect My HTML page to Homepage of Website想要将我的 HTML 页面重定向到网站的主页
【发布时间】:2021-02-17 22:57:05
【问题描述】:

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

【问题讨论】:

  • 或者如果无法重定向,请给我另一种方式谢谢
  • 到目前为止你尝试过什么?你被困在哪里了?这与 CSS 或主题的概念有什么关系?

标签: php html css themes custom-wordpress-pages


【解决方案1】:

如果你打算从new.html页面重定向到wordpressindex.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");

【讨论】:

    【解决方案2】:

    只需使用元刷新属性重定向到不同的站点。

    (content="0; 将立即重定向。)

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

    【讨论】:

      【解决方案3】:

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

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

      【讨论】:

        猜你喜欢
        • 2015-07-09
        • 2013-09-14
        • 2021-11-22
        • 2018-08-26
        • 1970-01-01
        • 2015-07-31
        • 2016-10-18
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多