KloakIt
Search Engine Stealth Technology

KloakIt 3.5 Help

Help Index

KloakIt PHP Lite

KloakIt PHP Lite is a helper script that is free (to licensed users of KloakIt) that was written in PHP which allows you to cloak PHP pages by calling it as an include.

The script itself is named "k.php" and it can be located anywhere in the document tree of your server. It doesn't have to be located in the same directory as your KloakIt installation.

KloakIt PHP Lite will cloak pages using the settings from the KloakIt Control Panel, but doesn't use KloakIt's templating system. Instead, you can configure it to do the following:

These options can be configured before the include statements, so you could have different behaviour performed by the script depending on how you include it.

KloakIt PHP Lite is excellent for cloaking pages generated by various page generation systems, like RSSGM (see the RSSGM KloakIt PHP Lite guide).

Include Instructions

Here is a sample include for KloakIt PHP Lite:

<?php
$humanURL = 'http://www.somedomain.com/landingpage.html'; $spiderURL = 'http://www.somedomain.com/optimized.html'; include('k.php'); ?>

The above include would show a human landingpage.html on somedomain.com. A spider would be shown optimized.html on somedomain.com. Note that the URL in the browser would not change in either case.

It is also possible to display a local file instead of calling a URL. Note that PHP and/or Server Side Includes in the file being called will not be parsed, nor will a CGI script be executed. Here's an example:

<?php
$humanURL = 'landingpage.html'; $spiderURL = 'optimized.html'; include('k.php'); ?>

You can get creative with the URLs, such as adding query information:

<?php
$humanURL = 'http://www.somedomain.com/landingpage.php?phrase=some+keyword+phrase'; $spiderURL = 'http://www.somedomain.com/optimized.php?phrase=some+keyword+phrase'; include('k.php'); ?>

The $humanURL and $spiderURL variables used before the includes above are optional in the include, but if you do not use them in the include, you should set them in the k.php file itself, on lines 67 and 68.

Configuration of k.php

Below is an example of the configuration section of the k.php file.

# KloakIt PHP Lite does require installation of the full KloakIt script. # You need to tell KloakIt PHP Lite the location of the KloakIt data # directory. If you changd the name of the data directory, make # $writedir equal to the new name and path of the directory. Also, if # KloakIt PHP Lite is located in a different directory than the KloakIt # installation, make sure $writedir contains the relative path to the # data directory. $writedir = "data"; # To turn off logging, set $logging to 0 $logging = 1; # You can set defaults here if (!$humanURL) { $humanURL = "http://www.somedomain.com/";} if (!$spiderURL) { $spiderURL = "http://www.somedomain.com/";}

There are four settings you can change in the configuration area: the name and path of the "data" directory, whether to disable logging, and the $humanURL and $spiderURL default settings.

The most important setting, and one that you will likely have to edit, is the path and name of the KloakIt "data" directory. During the installation of KloakIt, you may have changed the name of this directory. Also, if you are going to store k.php in a location other than the directory in which KloakIt is installed, you need to include the relative path information from the k.php file's directory to the KloakIt "data" directory. Note: you should NOT include a trailing forward slash at the end of this value. Here are some likely examples:

$writedir = "dirname/data";

or...

$writedir = "../dirname/data";

or...

$writedir = "some_name_you_chose_other_than_data";

The next item is the ability to disable logging for k.php. To turn logging off, just set the $logging variable to 0. Example:

$logging = 0;

Finally, you can set the defaults of the $humanURL and $spiderURL variables. The defaults are overridden when you specify values for these before the include. The value can either be a complete URL (by that I mean you must include the "http://" portion of the URL) or it can be a relative or absolute path to a file. If a path to a file is specified, the file will be read, not executed, which means that if it contains PHP, Server Side Includes, or is a Perl script, the source code of that script will be displayed, not run. Here are some examples of valid configurations for these variables:

if (!$humanURL) { $humanURL = "http://www.somedomain.com/index.html";} if (!$spiderURL) { $spiderURL = "http://www.some-other-domain.com/spiderfood.php";}

or...

if (!$humanURL) { $humanURL = "index.html";} if (!$spiderURL) { $spiderURL = "http://www.some-other-domain.com/spiderfood.php";}

or...

if (!$humanURL) { $humanURL = "index.html";} if (!$spiderURL) { $spiderURL = "dirname/spiderfood.html";}

or...

if (!$humanURL) { $humanURL = "index.html";} if (!$spiderURL) { $spiderURL = "http://www.some-other-domain.com/spiderfood.php?keyword=keyword+phrase";}


© 2002 Volatile Graphix, Inc. KloakIt is a trademark of Volatile Graphix, Inc.

KloakIt Cloaking Software