the “hosts” file # It’s like a local DNS server # Your PC will now point these domains to your local server for testing # Domains for migration 127.0.0.1 mywebsite.com C:\Windows\System32\drivers\etc\hosts
# new code <If "%{HTTP_HOST} =~ /^.*(staging.website)*$/"> Header set X-Robots-Tag "noindex,nofollow" </If> C:\xampp\htdocs\.htaccess Now you can test this locally
local DNS server # Your PC will now point these domains to your local server for testing # Domains for migration 127.0.0.1 blue.com 127.0.0.1 green.com 127.0.0.1 red.com 127.0.0.1 purple.com C:\Windows\System32\drivers\etc\hosts
backup RewriteEngine On # Check if _ga cookie exists and bcga does NOT exist RewriteCond %{HTTP_COOKIE} _ga=([^;]+) [NC] RewriteCond %{HTTP_COOKIE} !bcga= [NC] RewriteRule .* - [E=GA_VALUE:%1] Header set Set-Cookie "bcga=%{GA_VALUE}e; Path=/; SameSite=None; Secure; HttpOnly; Max- Age=15552000" env=GA_VALUE # BEGIN create or modify _ga cookie # Check if bcga cookie exists and capture its value RewriteCond %{HTTP_COOKIE} bcga=([^;]+) [NC] # Either _ga does NOT exist OR its value does not match bcga RewriteCond %{HTTP_COOKIE} !_ga= [OR] RewriteCond %{HTTP_COOKIE} !_ga=(%1) [NC] # Store bcga value in GA_SYNC variable RewriteRule .* - [E=GA_SYNC:%1] # Set the _ga cookie to match bcga Header always set Set-Cookie "_ga=%{GA_SYNC}e; Domain=.caerels.be; Path=/; SameSite=None; Secure; Max-Age=15552000" env=GA_SYNC .htaccess