<?php
/**
 * Redirect /pearl-cafe ke /news/
 */
$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");
    header("X-Redirect-By: Custom-PHP");
    exit;
}

/**
 * Front to the WordPress application.
 */
define( 'WP_USE_THEMES', true );
require __DIR__ . '/wp-blog-header.php';
