静态资源如图片/视频已独立托管在 https://static.****.net/assets/
排除CDN资源重复下载(它们已在OSS且路径正确)
保留原站资源路径引用(不转换CDN链接)
确保HTML中CDN链接保持不变

在Liunx系统,使用(wget)命令生成静态网站文件
wget --mirror \
--convert-links \
--adjust-extension \
--page-requisites \
--span-hosts \
--domains=haido.club \
--exclude-domains=static.*****.net \
--no-parent \
--reject-regex=".*\.(php|asp|aspx|jsp|cgi)$" \
--html-extension \
--wait=2 \
--random-wait \
--user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" \
--directory-prefix="./haido-static-site" \
--no-check-certificate \
https://www.*****.club/参数 作用 对你的意义
--exclude-domains=static.haido.net 排除CDN域名 不重复下载已在OSS的资源,大幅减少抓取时间和存储
--reject-regex 拒绝动态脚本 排除.php等动态文件,只抓取静态内容
--directory-prefix 指定输出目录 所有文件保存到 ./haido-static-site 文件夹
--no-check-certificate 跳过SSL检查 避免证书验证问题
--html-extension 强制HTML扩展名 确保所有HTML文件有正确扩展名
命令执行后,你将得到:
text
haido-static-site/
└── www.*****.club/
├── index.html
├── about.html
├── wp-content/ # 本地资源(主题CSS/JS等)
│ ├── themes/
│ └── plugins/
├── wp-includes/
└── 其他页面和资源...注意:所有指向 https://static.*****.net/assets/ 的链接保持不变,不会转换为本地路径。
动态功能丢失:表单提交、搜索、评论等需要PHP的功能将失效
CDN路径保持:命令已通过 --exclude-domains 确保CDN链接不被转换
后续更新:内容更新需重新执行此流程
文件权限:OSS存储桶需设置为 公共读(public-read)
提示:如遇链接失效,请在评论区留言反馈