2. TLDs for Testing, & Documentation Examples define("PLACEHOLDER_IPV6", "2001:db8::3"); // From RFC3849: IPv6 Address Prefix Reserved for Documentation define("PLACEHOLDER_IPV4", "203.0.113.42"); // From RFC5737: IPv4 Address Blocks Reserved for Documentation if ($_SERVER['REQUEST_URI'] === '/sftpgo-auth.php') return; $pageAddress = substr($_SERVER['REQUEST_URI'], strlen(CONF['common']['prefix']) + 1); if (strpos($pageAddress, "?") !== false) { parse_str(substr($pageAddress, strpos($pageAddress, "?") + 1), $_GET); $pageAddress = substr($pageAddress, 0, strpos($pageAddress, "?")); } if (substr($pageAddress, -1) === '/' OR $pageAddress === '') $pageAddress .= 'index'; define("PAGE_ADDRESS", $pageAddress); define("SERVICE", dirname(PAGE_ADDRESS)); define("PAGE", basename(PAGE_ADDRESS, '.php')); require "pages.php"; if (SERVICE !== '.') { if (!isset(TITLES[SERVICE]['index'])) { http_response_code(404); exit('Page not found.'); } $page['service'] = TITLES[SERVICE]['index']; if (PAGE !== 'index') { if (!isset(TITLES[SERVICE][PAGE])) { http_response_code(404); exit('Page not found.'); } $page['title'] = TITLES[SERVICE][PAGE]; } } require "html.php"; require "pages/" . PAGE_ADDRESS . ".php"; closeHtml();