Skip to content

Instantly share code, notes, and snippets.

@matsuu matsuu/ forked from zero-master/
Last active Sep 11, 2018

What would you like to do?
Show visitors from EU countries a page with GDPR message using Cloudflare and .htaccess

Turn on Cloudflare IP Geolocation

In your .htaccess file:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/blockedGDPR/
RewriteRule ^ - [F,L]

ErrorDocument 403 /blockedGDPR/

Create a file named index.html in blockedGDPR directory with the below content:

   GDPR Block
  We are unable to bear GDPR compliance cost at the moment.
    body {
      font-family: 'Avenir', Helvetica, Arial, sans-serif;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      color: #2c3e50;
      margin-top: 20px;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.