If you really have only pure static files, at least Apache has SSI or "Server Side Includes" with an introduction at https://httpd.apache.org/docs/current/howto/ssi.html which do as it is named, you can compose files on server by including one into another.
I wouldn't necessarily recommend doing that. Because it is still some CPU burnt at each page retrieval, for something, if purely static, that can be pre-computed once for all.
Instead, more probably I would see you should pre-generate your files, again if they are purely static. You can store them decomposed and then with the magic of some scripting and stuff like Makefile
you generate the final files out of the source content.
They exist various frameworks for static website and CMS that work that way.
Lots of them. I don't have personal experience with any of them, but at least names that often come on that topic are Gatsby, Hugo and Jekyll.
Pre-generating the files in advance though has the advanced benefit that the results are pure HTML and can be served by any webserver. When you are using a static engine, you may need to install specific stuff on the webserver for final rendering if there is no way to render pages in advance.
But if by
They will end up using a lot of the same code / files so it would make sense for both to point to the same info on the server
You mean absolutely the exact same content, then you even don't need all the above, Apache allows having multiple names/ServerAlias
statements, in order to tie a specific configuration including DocumentRoot
and hence files served to multiple hostnames. If you have an order form calling some other URL with a CGI, that script can itself consult Referer
or something added by Javascript running on the client side that would specify which of the hostname it was running on, so that you require only a single piece of code/back-end to fuel all your different front-end dynamic needs.