Skip to content

Instantly share code, notes, and snippets.

@karthikax
Created February 12, 2018 19:18
Show Gist options
  • Save karthikax/321d97b61dd46dc42faf09d1963f96b3 to your computer and use it in GitHub Desktop.
Save karthikax/321d97b61dd46dc42faf09d1963f96b3 to your computer and use it in GitHub Desktop.
Check Access via Cloudflare in PHP
<?php
if ( ! isset($_SERVER['HTTP_CF_VISITOR']) && ! isset($_SERVER['HTTP_CF_CONNECTING_IP']) ) {
die('Direct Access');
}
echo 'Cloudflare Access';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment