<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

// Requested URI
$requestUri = strtok($_SERVER['REQUEST_URI'], '?'); // strip query params

// Absolute path to filesystem target
$requestedFile = realpath($_SERVER['DOCUMENT_ROOT'] . $requestUri);

if (
    $requestedFile &&
    is_file($requestedFile) &&
    strpos($requestedFile, realpath(__DIR__)) === 0
) {
    header("Content-Type: " . mime_content_type($requestedFile));
    readfile($requestedFile);
    exit;
}

if (preg_match('#^/wp-(content|admin|includes)/#', $requestUri)) {
    define('WP_USE_THEMES', true);
    require __DIR__ . '/wp-blog-header.php';
    exit;
}

require __DIR__ . '/new/index.php';
exit;


/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );

/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
