Cloaking script

andrewpad

Newbie
Joined
Sep 11, 2018
Messages
1
Reaction score
0
Hi guys. I'm looking for a simple cloaking script. Requirements:

- Redirect visitors ONLY from search engines to a target URL;
- DO NOT redirect a visitor with direct referrers.

Where can I found one?
 
giphy.gif
 
Hi guys. I'm looking for a simple cloaking script. Requirements:

- Redirect visitors ONLY from search engines to a target URL;
- DO NOT redirect a visitor with direct referrers.

Where can I found one?

This is something that can be easily coded in PHP.

You don't need to pay $100s a month for a cloaker...
 
This is something that can be easily coded in PHP.

You don't need to pay $100s a month for a cloaker...
+1 For that

There is free script which allow visitors from specific source you need to do some search
 
Hi All, I am looking for a similar script where in the user gets the landing page where I want the user to be and bots/ campaign reviewer gets the landing page what they want to see. I don`t mind paying for the script. Let me know if anyone can help? Skype: [email protected]
 
Hi All, I am looking for a similar script where in the user gets the landing page where I want the user to be and bots/ campaign reviewer gets the landing page what they want to see. I don`t mind paying for the script. Let me know if anyone can help? Skype: [email protected]

It won't be easy detecting who the campaign reviewer is unless you know something about them (country, region, etc) and that they won't use a VPN or some other way to bypass your checks. Caveat emptor.
 
Something like this should work. Could also be done in javascript.

Code:
if (strpos($_SERVER['HTTP_REFERER'], 'google.com') !== false || strpos($_SERVER['HTTP_REFERER'], 'yahoo.com') !== false || strpos($_SERVER['HTTP_REFERER'], 'bing.com') !== false ||) {
    header('Location: http://www.your-landing-page.com');
    exit;
} else {
    header('Location: http://www.send-bad-traffic-someone-else.com');
    exit;
}
 
PHP:
<?php

function redirectOrganicTraffic()
{
    $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';

    // Do not redirect if referer is missing.
    if (!$referer) {
        return;
    }

    // Parse hostname from URL.
    $host = parse_url($referer,  PHP_URL_HOST);

    // Do not redirect if hostname is missing.
    // This might happen if referer is invalid URL.
    if (!$host) {
        return;
    }

    // Remove leading www from hostname.
    $host = preg_replace('/^www\./i', '', $host);

    // Add more search engine domains if you need.
    $searchEngines = [
        'google.com',
        'bing.com',
        'duckduckgo.com',
    ];

    foreach ($searchEngines as $searchEngine) {
        if ($host === $searchEngine) {
            header('Location: https://example.com/?page=money');
            exit;
        }
    }
}

redirectOrganicTraffic();

?>

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Hello, world!</title>
</head>
<body>
    <h1>Hello, world!</h1>
</body>
</html>
 
I wouldn't call this example cloaking, looks more like prelander.
Basically it's a link that has onclick event handler that replaces window location (redirects without back button history).

From page source:

1. Declare URL as url variable.

HTML:
<script>var url = 'https://t2m.io/TH2n4NiK';</script>

2. Add link with url id.

HTML:
<a href="#" id="url" class="btn btn-warning btn-lg" style="font-size:200% !important; margin-top: 10px;">Klicken Sie hier.</a>

3. Find link by getElementById function and add onclick event handler.

Code:
<script>
document.getElementById("url").onclick=gogogo;
       
function gogogo()
{
    top.location.replace(url);
    return false;
}
</script>
 
This simple script you can get in stackoverflow not paid and use if you wana advance level script then hire a developer to develop this
 
Necroing this thread to ask about how to use that script for each post on a custom site made on NGINX.
 
Necroing this thread to ask about how to use that script for each post on a custom site made on NGINX.
 
Hi guys. I'm looking for a simple cloaking script. Requirements:

- Redirect visitors ONLY from search engines to a target URL;
- DO NOT redirect a visitor with direct referrers.

Where can I found one?
This can be easily done by identify the source ( if Google : send to this URL ) .
 
Back
Top