I recently saw an increase in traffic (in Google Analytics and in my logs) on my MT site and discovered that some external sites are using one of the meteotemplate pages to redirect their users to different websites.
My first to option was to kill the visit but then I thought there was no harm in just redirecting them to the homepage of my site.
I added the following code before the html tag of the pages/station/redirect.php file and it looks like it is working as expected :
Code: Select all
<?php
// This is to check if the request is coming from a specific domain
$ref = $_SERVER['HTTP_REFERER'];
$refData = parse_url($ref);
if($refData['host'] == 'cerrajerosgasteiz.com') { // replace by the offender website
//die("Hotlinking not permitted");
$address ="https://elspinars.es/"; // replace by your own domain name
}
?>Cheers,
Pol-Brieuc
