function generateId($string = '', $len = 8)
{
$letters = array_merge(range('a', 'z'), range('A', 'Z'), range(0, 9));
$x = 0;
while ($x < $len) {
$string .= $letters[array_rand($letters)];
$x++;
}
return $string;
}
RewriteRule ^([a-zA-Z0-9]+)$ redirect.php?key=$1