, so WhatsApp / Facebook / Google see the real page. // Reached through .htaccess (the visitor's address stays course-details.html?slug=…). The page itself is unchanged. declare(strict_types=1); define('NA_ROOT', __DIR__); ini_set('display_errors', '0'); $page = ($_GET['p'] ?? '') === 'news' ? 'news' : 'course'; $file = NA_ROOT . ($page === 'news' ? '/news-details.html' : '/course-details.html'); $html = (string)@file_get_contents($file); header('Content-Type: text/html; charset=utf-8'); header('Cache-Control: no-cache, must-revalidate'); header('X-Content-Type-Options: nosniff'); header('X-Frame-Options: SAMEORIGIN'); function seo_out(string $html): void { echo $html; exit; } /** News bodies are written in the control panel (already cleaned there); keep only harmless formatting tags here too. */ function na_clean_html_safe(string $h): string { $h = preg_replace('~<(script|style|iframe|object|embed|form)\b.*?~is', '', $h) ?? ''; $h = strip_tags($h, '