Restructure project for security and offline capability

- Move content outside public web root for security
- Consolidate all code and assets in engine/ directory
- Download Bootstrap locally for offline functionality
- Update public/ to contain only entry point files
- Add router.php for PHP development server security
- Update README.md with new structure and setup instructions
- Block direct access to content files via URL
- Maintain clean separation between content and code
This commit is contained in:
2025-11-19 17:05:25 +01:00
parent 277f86346d
commit 494ae7dc3b
28 changed files with 2707 additions and 102 deletions

View File

@@ -1,8 +1,8 @@
<?php
require_once 'config.php';
require_once __DIR__ . '/../engine/core/config.php';
$config = include 'config.php';
$config = include __DIR__ . '/../engine/core/config.php';
class CodePressCMS {
private $config;
@@ -437,5 +437,13 @@ class CodePressCMS {
}
}
// Block direct access to content files
$requestUri = $_SERVER['REQUEST_URI'];
if (strpos($requestUri, '/content/') !== false) {
http_response_code(403);
echo '<h1>403 - Forbidden</h1><p>Direct access to content files is not allowed.</p>';
exit;
}
$cms = new CodePressCMS($config);
$cms->render();