Skip to content
Home » Blog » HTML Template System

HTML Template System

Lets assume you want to have 100 different landing pages for Amazon product niches.

Setting up 100 domains manually, creating all the HTML, that would be a waste of your valuable lifetime. Especially if you ever wanted to change something to the landing page template. That would mean you would have to make that change with all 100 domains… a source of endless error and pain.

We don’t want to travel that path, do we?!

Instead we create our own little content management system.

Here’s a screenshot of the source of some simple but nice looking template I used 10 years ago. It’s very simple HTML.


As you can see with those ‘{–xyz–}‘, there are placeholders, aka template tags.

We store the template tags and corresponding values for each domain in some file, for example domain.tld.txt

You either create those txt files by hand, or you create some neat little dashboard for the config, like in the following screenshot of my system:

And here’s how the end result looks like, after you parsed all the template tags:


This is super basic.

Lets spin this further.

Every time a request hits your webserver you check for the domain (I think $_SERVER[‘HTTP_HOST’], haven’t used PHP since ages), open the config txt for that domain, parse the template and make a log entry for that domain in your database. Add a function to get the amount of hits from the database and, voilà, you have a little CMS with logging.

Now spin this further.

Maybe let your little script generate a bunch of stuff based on a keywords file you specified in your config txt and only show the landing page template to human visitors. Voilà, you have a little cloaker.

It’s not that complicated. Use mass, use expired domains.

If you have any questions, drop them in the comments.

Happy building.

2 thoughts on “HTML Template System”

  1. For the last couple of days, I bought a VPS + couple domains and learned how to set up and config Apache, Nginx, and Mariadb.

    Lists of things I played around with:

    1. Go back and forth in directories.
    2. Display nonprinting characters.
    3. How to change the Windows line-ending to the Unix version.
    4. Use the database, show/alter tables and columns, and add/drop columns.
    5. Creating 100x directories line by line based on what is given in file.txt.
    6. Change strings in files in the current and subdirectories.
    7. Duplicate file x times.
    8. Retrieve data from a MariaDB database and display it on my website.
    9. Noob cloaker that outputs different things for User-Agent
    10. Lots of searching for solutions.

    I tried all these with no operating system or cpanel, just pure commands.

    Below are the things I’m still trying to figure out and accomplish.

    1. What you want to do next is running your server as a kind of ‘catchall’ system, which accepts all requests and redirects them to one script (PHP for example). The PHP then ‘decides’ what to serve.

    For example you could have a configs folder which holds config files for your domains like domain.tld.txt, domain2.tld.txt where you load which template to use, which title to set.

    That way you can easily add more domains without having to touch your webserver config and add domains there. A server could handle that way thousands of domains easily.

    2. We store the template tags and corresponding values for each domain in some file, for example domain.tld.txt

    You either create those txt files by hand, or you create some neat little dashboard for the config, like in the following screenshot of my system:

    3. Every time a request hits your webserver you check for the domain (I think $_SERVER[‘HTTP_HOST’], haven’t used PHP since ages), open the config txt for that domain, parse the template and make a log entry for that domain in your database. Add a function to get the amount of hits from the database and, voilà, you have a little CMS with logging.

    I’m trying to put all these pieces together, one by one. If you can give me some advice on how to accomplish these three things, I will be so happy. The three things above have been bugging me day and night, and I just can’t seem to wrap my head around them.

  2. That’s great man!

    Love to hear that you are taking action and learning a lot.

    I’ll try to make a post ready addressing the things with the Webserver and having one script serve all domains. Will became clearer, when you see the code.

Leave a Reply

Your email address will not be published. Required fields are marked *