Login
登录 注册 安全退出
当前位置: 首页 > 文档资讯 > 技术教程 > WordPress博客首页如何静态

WordPress博客首页如何静态

时间:2025-10-29浏览: [ ]

WordPress博客首页如何静态

wordpress博客首页静态的方法如下:

首先新建一个php文件,文字可以自取,自己要记住,比如index-html.php,然后复制以下代码:

<?php $baseCmsUrl = "https://www.ziyouwu.com";
$dmPageName = "index.php";
$stPageName = "index.html";
$tureStFile = dirname(__FILE__).&#39;/&#39;.$stPageName;
{
        $body = file_get_contents($baseCmsUrl.&#39;/&#39;.$dmPageName);
        $fp = fopen($tureStFile, &#39;w&#39;);
        fwrite($fp, $body);
        fclose($fp);
}
if(file_exists("index.html"))
 {
unlink("index.html");
 }
$baseCmsUrl = "https://www.ziyouwu.com";
$dmPageName = "index.php";
$stPageName = "index.html";
$tureStFile = dirname(__FILE__).&#39;/&#39;.$stPageName;
{
        $body = file_get_contents($baseCmsUrl.&#39;/&#39;.$dmPageName);
        $fp = fopen($tureStFile, &#39;w&#39;);
        fwrite($fp, $body);
        fclose($fp);
}
header("Location:$baseCmsUrl/index.html");
?>
登录后复制
复制本文链接文章为作者独立观点不代表优设网立场,未经允许不得转载。