Directory Structure
RuntCMS is designed for shared hosting. Everything lives in a single flat directory — your public_html folder (or equivalent). There's no separate "web root" to configure.
Full layout
public_html/
├── index.php ← Front controller — handles all page requests
├── install.php ← Installer (disabled after use via install.lock)
├── install.lock ← Prevents installer from running again
├── .htaccess ← Apache rewrite rules
├── config.php ← Database credentials and site config (created by installer)
│
├── cms/ ← All site content (one place, familiar layout)
│ ├── pages/ ← HTML page files ({slug}.html) — not web-accessible directly
│ │ ├── home.html
│ │ ├── about.html
│ │ └── contact.html
│ ├── css/ ← Your site's CSS files (web-accessible)
│ ├── js/ ← Your site's JS + runtbar.js built asset (web-accessible)
│ ├── uploads/ ← Uploaded images (web-accessible)
│ └── templates/ ← Shared template files (not web-accessible directly)
│
├── app/ ← PHP application (PSR-4 namespace: RuntCMS\)
│ ├── Controllers/
│ ├── Core/
│ └── Models/
│
└── vendor/ ← Composer dependencies (do not edit)
cms/pages/
This is where your page HTML files live. Each page has one file named {slug}.html. When a visitor requests /about, RuntCMS reads cms/pages/about.html and renders it.
The .htaccess file inside cms/pages/ prevents direct web access to these files — all requests go through index.php.
A typical page file might look like this:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{cms:page:title} — My Site</title>
<meta name="description" content="{cms:page:description}">
{cms:site:favicon}
<link rel="stylesheet" href="{cms:site:path}/cms/css/site.css">
</head>
<body>
<nav>{cms:nav:pages}</nav>
<main>
<h1 data-cms-region="hero-title">Welcome</h1>
<div data-cms-region="hero-body">
<p>Edit this text by clicking it.</p>
</div>
</main>
{cms:system:runtbar}
</body>
</html>
cms/templates/
Optional. Use this directory for shared HTML snippets you want to include across multiple pages — for example, a common header and footer. There is no built-in PHP include mechanism for these; you'd reference them from your page files however you prefer, or use Partials for RuntCMS-aware reusable blocks.
cms/css/ and cms/js/
Put your site's stylesheet and JavaScript files here. These are web-accessible, so you can reference them in your page HTML:
<link rel="stylesheet" href="{cms:site:path}/cms/css/site.css">
<script src="{cms:site:path}/cms/js/site.js"></script>
The built runtbar assets (runtbar.js and runtbar.css) are also placed here by the build process and injected automatically by {cms:system:runtbar} — you don't need to link them manually.
cms/uploads/
Uploaded images are stored here. Filenames include a timestamp hash to prevent collisions. The web server needs write permission on this directory.
Do not reorganise or rename files inside uploads/ — RuntCMS tracks image file references in the database by filename.
config.php
Created by the installer. Contains database credentials, site URL, and other configuration. Do not commit this file to version control — it contains secrets.
If you need to change database credentials after installation (e.g. after migrating hosts), edit config.php directly. The file is PHP, not INI or YAML:
<?php
define('DB_HOST', 'localhost');
define('DB_NAME', 'your_database');
define('DB_USER', 'your_user');
define('DB_PASS', 'your_password');
define('SITE_URL', 'https://yourdomain.com');
app/ and vendor/
The PHP application code and its Composer dependencies. You generally don't need to touch these unless you're customising RuntCMS itself. The app/ directory uses the PSR-4 autoloader with the namespace RuntCMS\.