⚠️ Step 1: Configure your web server
This is not optional. bare-site's entire security model depends on the web server blocking direct access to PHP files. The framework will not work without these rules.
nginx (recommended)
Copy nginx/default.conf to your server and update the paths. The three critical rules:
# 1. ONLY index.php can execute — all other PHP files are blocked
location = /index.php {
include fastcgi_params;
fastcgi_pass unix:/run/php/php8.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ \.php$ { return 404; } # ← blocks config.php, functions.php, etc.
# 2. Everything routes through index.php
location / { try_files $uri $uri/ /index.php?$query_string; }
Apache (.htaccess)
RewriteEngine On
# Route everything through index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
# Block direct access to PHP files except index.php
RewriteCond %{REQUEST_URI} !^/index\.php$
RewriteRule \.php$ - [R=404,L]
Caddy
your-domain.com {
root * /var/www/html
php_fastcgi unix//run/php/php8.4-fpm.sock
file_server
# Block direct PHP access except index.php
@blockedPhp path_regexp /(?!index\.php$).*\.php$
respond @blockedPhp 404
}
2. Drop the files on a server
git clone https://your-repo/bare-site.git /var/www/html/ # or just copy the html/ directory contents
3. Edit your config
Open class/config.php and set:
SITE_NAME— your site titleSITE_DESCRIPTION— meta description- Page slugs (
PAGE_00_SLUGthroughPAGE_05_SLUG) - Supported languages in
$languagesarray - Optional:
GEO_KEYfor visitor location,TELEGRAM_*for notifications
4. Create your pages
lng/en/ ├── menu.php # navigation labels + error messages ├── home.phtml # your content — raw HTML, no template engine ├── about.phtml # another page └── start.phtml
Content files are plain HTML inside a <section>. No template syntax to learn. You can use PHP inline if needed — <?php echo date('Y'); ?>.
5. Add a language
# 1. Add to config.php: $languages = ['en' => 'English', 'de' => 'Deutsch']; # 2. Create the directory and copy files: mkdir lng/de/ && cp lng/en/* lng/de/ # 3. Translate menu.php + .phtml files # Done — appears in the nav dropdown automatically.
Optional features
| Geo-location | Set GEO_KEY (free at ipgeolocation.io) |
| Telegram alerts | Set TELEGRAM_BOT_TOKEN + TELEGRAM_CHAT_ID |
| Weekly logs | Auto-rotated: logs/errors_2026-W26.log |
| Article sub-pages | Create lng/en/start/{slug}.phtml → routed at /start/{slug} |
| Multi-language | Auto-detect from Accept-Language header. This demo ships with 7 languages. |