Skip to content

Instantly share code, notes, and snippets.

View austinsparx's full-sized avatar

Austin120 austinsparx

View GitHub Profile
@tjhole
tjhole / WORDPRESS: Redirect based on location using Cloudflare
Created April 4, 2014 10:27
WORDPRESS: Redirect based on location using Cloudflare
<?php
// Geo Redirect using Cloudflare
$activepage = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$country_code = $_SERVER["HTTP_CF_IPCOUNTRY"];
$page_from = "www.domain.tld/";
$page_to = "www.newdomain.tld/";
?>
<!-- Country Code : <?php echo $country_code; ?> -->
<!-- Active URL : <?php echo $activepage; ?> -->