Skip to main content
Website Protection PHP Mode
Updated over 2 years ago

Before start, make sure you have read about Website Protection General Settings.

Website Protection with Redirect

1. In the General campaign settings, select 301 redirect for users as To URL. In the field that appears, specify the site URL that will only be displayed to users.

2. Go to the Website Protection tab.

3. Download the PHP script to your computer, then transfer this file to the hosting and connect it on your website. You will see in the archive a script with a name like 146-15FeYt. For convenience, change the name, for example, to playok. Upload this file to your hosting.

4. Go to the main page of the site in the index.html file and write the following two lines at the top (steps 2 and 4 on the PHP script tab):

<?php include("Path to file"); ?>
<?php \BotDetecter::redirectIfNotBot(); ?>

5. Save the changes.

6. Then change the file format from index.html to index.php.

Make sure your PHP version is at least 7.0.


If done correctly, the files on your hosting will look something like this:

where index.php is the landing page, playok.php is the website’s protection file.

Website Protection without Redirect

1. In the General campaign settings, select 301 redirect for users as Without.

2. Go to the Website Protection tab.

3. Download the PHP script to your computer, then transfer this file to the hosting and connect it on your website. You will see in the archive a script with a name like 146-15FeYt. For convenience, change the name, for example, to playok. Upload this file to your hosting.

4. Go to the main page of the site in the index.html file and write the following two lines at the top (steps 2 and 3 on the PHP script tab):

<?php include("playok.php"); 
<?php if(\BotDetecter::isBot()){ ?>Block shown to the bot<?php } ?>
<?php if(\BotDetecter::isNotBot()){ ?>Block displayed to the user<?php } ?>

5. Save the changes.

6. Then change the file format from index.html to index.php.

Make sure your PHP version is at least 7.0.


If done correctly, the files on your hosting will look something like this:

where index.php is the landing page, playok.php is the website’s protection file.

Did this answer your question?