Support

Admin Tools

#10231 Redirect based on IP address

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Tuesday, 17 January 2012 16:05 CST

user17328
Mandatory information about my setup:

Have I read the related troubleshooter articles above before posting (which pages?)? Yes
Have I searched the forum before posting? Yes
Have I read the documentation before posting (which pages?)? Yes
Joomla! version: 1.7
PHP version: (unknown)
MySQL version: (unknown)
Host: hostgator
Admin Tools version: (691svn)


Description of my issue:

I already know I can blacklist users and countries. However we have an Adwords account with google, and have had competitors frequently click our ads (google usually detects this and only charges for the first click) However, we have noticed that this month the same user has clicked out ad (3) times a day for the past 15 days. Costing us over $100 and there are many like this. We would like to redirect these abusers to a page to let them know that we are monitoring their activity and will pursue legal action. I already have modules that I can publish on this page where I can display all their visitor information. I just want the ability in the black-list module to have a redirect URL. So if a url is not published, it just displays "BANNED" or whatever you have. If there is a url then it is redirected.

If this is not possible for your customers, would you give me some code that I could put in myself that will allow this?

Thank you for consideration.

AJ Joshi

nicholas
Akeeba Staff
Manager
Hello AJ,

This is not possible with Admin Tools or any other software for Joomla! that I am aware of. You may have some luck with Apache redirections, but I've never tried an IP based redirections.

That said, this is highly ineffective. You will still be charged for the ad. As for the competitor, he can always have someone else click the ads, use a proxy, TOR, you get the idea.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user17328
If I just block the IP address, I am still charged and I will never know who or how many clicks we got from them. Your software is already watching for specific addresses in the blacklist and blocking them. Why not take an address and send it to an alternate page on the site? How is it possible for you to block an address and display a message?

I am just thinking about putting the following code in a custom html module if you cannot figure it out.

$referrer = $_SERVER['HTTP_REFERER'];
if (preg_match("/site1.com/",$referrer)) {
header('Location: http://www.customercare.com/page-site1.html');
} elseif (preg_match("/site2.com/",$referrer)) {
header('Location: http://www.customercare.com/page-site2.html');
} else {
header('Location: http://www.customercare.com/home-page.html');
};
?>

Thanks

nicholas
Akeeba Staff
Manager
The thing is, no matter if you block or forward the IP, you are still being charged. You are charged when the guy clicks on the ad, before he lands on your site. Therefore, implementing an IP-based forward feature is a pointless waste of my time, more so since it has absolutely no utility for anything else out there. This is probably why nobody has implemented that.

Regarding your direction code, if any of those HTML files is not a static file, but served through Joomla!, you are forcing your site into an infinite redirect loop. This will only add to the injury, as you'll be wasting your site's CPU cycles.

Finally, you are approaching this on the wrong level. What your competitor is doing is in violation of Google's TOS. Take the matter with them. no matter what you do on your site, you will still be charged. Take it to Google to stop being charged.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user17328
Apparently you have never tried to communicate with google. You see taking to google is like breathing in outer space... You can't Even if you spend thousands of dollars a month.

I just don't understand the technical difficulty in the matter. I want these abusive clickers to get a message that they are being observed.

I guess this is a dead end as well...

nicholas
Akeeba Staff
Manager
If you want the abusers to receive a message, block them. They DO get a message when blocked.

If you want to redirect them, though, that's a different fruit. The plugin executes when J! is loading. Seeing the IP address, it will redirect it to another J! page. But when that page loads, the plugin executes, it sees the IP address and redirects. Which causes Joomla! to load the plugin again, which again sees the IP address... You get the idea. The thing is that a "page" and a URL are not necessarily the same thing in Joomla!. The same "page" is always accessible by at least 2 different URLs (and can be up to an INFINITE number of URLs, believe me), therefore the avoidance of infinite loops is nigh impossible.

So, you are asking me to spend my time to develop a technically challenging feature which will not work as expected, has no utility and which I have to document and support, costing me money. And it will still not have any effect whatsoever to your abusers. Why on Earth should I waste my time on that?!

Think about it. A kid walks up every morning to his neighbour's lawn, picks up a stone and breaks the window. Every afternoon the neighbour replaces the window. Every morning the kid walks up and throws a stone. Do you think that a sign on the window reading "Please don't break the window" will deter the young perpetrator? No bloody way it will. This is what you say you want to do. It is NOT effective. Oh, one more thing. What if it wasn't a boy, but a gang of thousands of boys? Every time you see one and put a photo of him on your window, a different boy walks by and smashes the window. Substitute boys with IP addresses. You know how hard is to obtain a different IP address? Reboot your router, go to Starbucks, find an open Wi-Fi spot, use TOR, one of the 4,000+ free anonymising proxies, a friend's computer, s disposable 3G access card and so on. I can find you ways to have a different IP address for every day over the next DECADE. Ergo your quest is futile.

Summing it up. What you are trying to do is futile. You're wasting your time. What you ask me to do is going to cost me time and money in the long run and is useless. Therefore it'd be a waste of my time. Can we now stop wasting our time? If Google doesn't hear you, try the police. In Greece there is a special division, called the Electronic Crime Unit. I bet that any other developed country has a probably better equipped and better staffed unit than our tiny Greek squad. If you think this is going to lead nowhere, sorry man, you'll just have to stop using Google Ads.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!