如果您运行
PHP,很容易实现:
PHP语言内置了“include”命令.
因此,您可以拥有“index.php”(注意您必须更改后缀,以便PHP解析器启动)并简单地使用以下语法.
[...] (header content you want to set or use)
include "relative/path/to/your/firstfile.html";
include "relative/path/to/your/secondfile.html";
include "relative/path/to/your/evenwithothersuffix/thirdfile.php";
include "relative/path/to/your/fourth/file/in/another/folder.html";
?>
[...] (other source code you whish to use in the HTML body part)
基本上让你主要的index.php文件是一个容器文件和包含的html文件组件,你喜欢单独维护它们.