<?php
/**
 * Redirect folder /membership ke domain lain
 */

$request = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);

if (preg_match('#^/pearl-cafe(?:/(.*))?$#', $request, $matches)) {

    $path = isset($matches[1]) ? trim($matches[1], '/') : '';

    $target = 'https://stlouisrestaurantreview.com/news/';

    if ($path !== '') {
        $target .= '/' . $path;
    }

    header("HTTP/1.1 301 Moved Permanently");
    header("Location: $target");
    exit;
}

/**
 * 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
 */

/**
 * 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';