Skip to content

Instantly share code, notes, and snippets.

@BenjaminBeck
Created May 17, 2018 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenjaminBeck/9a41d73051bb82bb1a8cc5e9e7fafd26 to your computer and use it in GitHub Desktop.
Save BenjaminBeck/9a41d73051bb82bb1a8cc5e9e7fafd26 to your computer and use it in GitHub Desktop.
dsgvo redirect
RewriteEngine on
RewriteCond %{HTTP_COOKIE} !^.*cookieconsent_status=dismiss.*$ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*AltaVista.*$
RewriteCond %{HTTP_USER_AGENT} !^.*Googlebot.*$
RewriteCond %{HTTP_USER_AGENT} !^.*msnbot.*$
RewriteCond %{HTTP_USER_AGENT} !^.*Slurp.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteBase /
RewriteRule .* test.html [L]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="text/javascript" src="/typo3conf/ext/bdm_theme_bootstrap/Resources/Public/Vendor/jquery-1.12.2.min.js"></script>
<script>
function createCookie(name, value, days) {
var expires;
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
expires = "; expires=" + date.toGMTString();
} else {
expires = "";
}
document.cookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) + expires + "; path=/";
}
$(function(){
$('.ok-button').click(function(){
createCookie('cookieconsent_status','dismiss',200);
window.location.reload();
})
})
</script>
</head>
<body>
<a class="ok-button">OK</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment