It is possible to replace the default template that Ploi gives you for each newly created site. In this article we will show you how easy this is.

Start by logging in via SSH into your server as the ploi user.

Next decide whether you want to use HTML or PHP, if there is a HTML file this will be used first.

Run this command to create an empty HTML file:

touch /home/ploi/.ploi/default-template.html

If you want to use PHP, run this command:

touch /home/ploi/.ploi/default-template.php

Now you can edit this file and any HTML or PHP code. You may also do all these actions via your favorite SFTP application.

We also provide a few variables for you that you can use inside this template that will get replaced.

  • {DOMAIN} - returns the actual domain, e.g: example.com
  • {DOMAIN_CREATION_DATE} - returns the creation date of the domain
  • {YEAR} - returns the current year, useful for copyright footers

An example template:

<!doctype html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
   <meta http-equiv="X-UA-Compatible" content="ie=edge">
   <title>Welcome to my site {DOMAIN}</title>
</head>
<body>
  Hi! You've just landed on {DOMAIN}, this was created on {DOMAIN_CREATION_DATE}.
  
  <br />
  
  Copyright (c) {YEAR}
</body>
</html>

After this just create a fresh domain and view your own template.

When you do not configure this, Ploi will upload the basic template by default.

24 June 2021 (last updated 2 years ago)

6654 views

Written by Dennis Smink

Dennis brings over 6 years of hands-on experience in server management, specializing in optimizing web services for scalability and security.

Back to Domains


Start free trial