<?php
header('Content-Type: text/html; charset=utf-8');
require_once('includes/idna_convert.class.php');
$IDN = new idna_convert();
if (isset($_SERVER['QUERY_STRING']))
{
$location = urldecode($_SERVER['QUERY_STRING']);
if (!preg_match('#.#u', $location))
{
$location = iconv('Windows-1251', 'UTF-8', $location);
}
$location = $IDN->encode_uri($location);
Header('Location: '.$location);
}
?>