Overview #
The PHP Paste method is a quick way to implement cloaking by inserting a PHP script into your landing page. This method is ideal for users who manage their pages manually and need a direct integration.
Steps to Implement PHP Paste Cloaking #
1. Generate the PHP Script #
- Log in to TrafficShield and navigate to the Integration section.
- Select PHP Paste Method and copy the provided script.
2. Paste the Script in Your PHP File #
- Open your
index.php
or landing page file.
- Paste the script at the very top of the file.
<?php $cloak_url = "https://yourdomain.com/cloak-check"; $response = file_get_contents($cloak_url); $data = json_decode($response, true); if ($data['redirect']) { header("Location: " . $data['url']); exit(); } ?>
3. Test the Implementation #
- Open your website and verify redirections.
- Use different IPs, browsers, and referrers to ensure proper cloaking behavior.