Need to cloak my LP and show bogus content to specific ip and town/city.

mpbiz

New member
Apr 29, 2010
2,824
57
0
Need to cloak one of my LP's from a competitor. Once I finally get my hands on his ip address, how can I show him different LP content than my regular visitors?

I found this code here but it does an actual redirect, and I don't want my competitor to know that he is seeing bogus content. I'm not looking for a FB cloaker or anything like that. Literally just need to show one competitor bogus content.

Code:
RewriteEngine on
RewriteCond %{REMOTE_ADDR} ^56\.150\.186\.229$ [OR]
RewriteCond %{REMOTE_ADDR} ^89\.103\.221\.49$ [OR]
RewriteCond %{REMOTE_ADDR} ^25\.53\.91\.24$ [OR]
RewriteCond %{REMOTE_ADDR} ^82\.151\.156\.151$
RewriteRule http://www.example.com/websitepage [L,R=301]

Anyone know how I can accomplish this WITHOUT redirecting my competitor?

Also anyone know how to do this for not just the ip but the town or city as well?
 


I'd do it in php like this:

Code:
<?php
$competitors = array("56.150.186.229", "89.103.221.49", "25.53.91.24", "82.151.156.151");

if (in_array ($_SERVER['REMOTE_ADDR'], $competitors)) {
   ?>fake landing page html code<?php

} else {
   ?>real landing page html code<?php
}
?>
 
  • Like
Reactions: Goodcat and mpbiz
I'd do it in php like this:

Code:
<?php
$competitors = array("56.150.186.229", "89.103.221.49", "25.53.91.24", "82.151.156.151");

if (in_array ($_SERVER['REMOTE_ADDR'], $competitors)) {
   ?>fake landing page html code<?php

} else {
   ?>real landing page html code<?php
}
?>

This is a good way of doing it. Are you sure your competitor has a static IP? Why not drop a evercookie - virtually irrevocable persistent cookies on him to be safe?
 
  • Like
Reactions: mpbiz
Starfish and mattseh thanks for the help.

Mattseh I'm mobile so I can't check out the ever cookie code, but it sounds perfect. Any idea how I can modify starfishe's code to check for the cookie and IP address?
 
Use free ip2Location API... just google, there are quite a few of them.