Chapter 13 · 13.3
Installing in a subfolder or on a subdomain
Watch it in a short video
You don't always have to put WordPress on your main domain. You can create a second website in a subfolder (yourdomain.com/blog) or on a subdomain (blog.yourdomain.com). Handy for a blog alongside your existing site, a test site, or a separate site for a project.
In a subfolder
- Start the installation as described in Installing WordPress.
- Choose your domain under Domain.
- Type the name of the folder under Path (Optional), for example blog. Without a forward slash before or after it.
- Install. WordPress will then be available at yourdomain.com/blog, and the files will be stored in public_html/blog.
If the folder doesn't exist yet, Installatron creates it for you. Choose a folder that doesn't already contain another website.
On a subdomain
- First create the subdomain in DirectAdmin under Subdomain Management (see Creating and deleting subdomains). Also request an SSL certificate that covers the subdomain (see Certificate for www, subdomains and wildcard).
- Open Installatron again and start the installation as described in Installing WordPress.
- Choose the subdomain under Domain, for example https://blog.yourdomain.com. Don't see the subdomain in the list? Choose your main domain under Domain at the top right, or refresh the page: new subdomains only appear after reopening it.
- Leave Path (Optional) empty and install.
Subfolder or subdomain: which should you choose?
| Subfolder (yourdomain.com/blog) | Subdomain (blog.yourdomain.com) | |
|---|---|---|
| For Google | Belongs to your main site | Seen more as a separate site |
| Extra setup | None | Creating a subdomain and SSL certificate |
| Suitable for | A blog or part of your own site | A separate site, test environment or webshop |
Please note: Each installation is a complete website with its own database. They all count towards your storage space and your number of databases. And keep track of them all: a forgotten test site with an old version of WordPress is an easy way in for hackers. Delete what you no longer use (see Deleting an installation).
Tip: Want to move your website from a subfolder to your main domain later? Don't move the files manually, use Clone in Installatron instead (see Cloning and creating a staging environment). This also updates all the addresses in the database.
