With Apache, it is possible to define variables per user-agent connecting to the server. This is described in detail
in http://httpd.apache.org/docs/howto/ssi.html#advancedssitechniques
.
Alkaline's user-agent is AlkalineBOT
by default.
For server-side includes, add the following to your .conf file for your web site:
BrowserMatchNoCase AlkalineBOT Alkaline
|
This will define a variable
Alkaline
whenever the spider indexes the page.
Then add the following code around your ssi calls:
<!--#if expr="${Alkaline}" -->
Alkaline will not see the code here
<!--#else -->
everybody else will see the code here
<!--#endif -->
|
For php, use:
if (!preg_match("/AlkalineBOT/i", $HTTP_USER_AGENT))
{
everybody, except Alkaline will see the code
}
|