Domänriktningen är svårtast, själv har jag en egen webbserver som tar hand om alla domänerna.
Hursomhelst, när du väl riktat domänen till ditt webbhotell lägger du in koden nedanför i en fil som heter index.php (båda styckena). Ftp:a över index.php tillsammans med de två filerna jag postade länk till den 27:e.
Komplett index.php fil. Ladda ner tillhörande fil i mitt inlägg den 27:e.
PHP-kod:
<?php
$rubrik = getenv('HTTP_HOST');
// Include the class
include_once('idna_convert.class.php');
// Instantiate it (depending on the version you are using) with
$IDN = new Net_IDNA_php4();
// The input string
$input = $rubrik;
// Encode it to its punycode presentation
$output = $IDN->decode($input);
// Output, what we got now, if output should be in a format different to UTF-8
// or UCS-4, you will have to convert it before outputting it
$rubrik = utf8_decode($output); // This will read: andre@börse.knürz.info
$rubrik = str_replace('www.','',$rubrik);
$rubrik = str_replace('-',' ',$rubrik);
$rubrik = str_replace('.se','',$rubrik);
?>
HTML-kod:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; CHARSET=utf8" />
<title><?php echo $rubrik; ?></title>
<meta name="keywords" content="<?php echo $rubrik; ?>"/>
<meta name="description" content="Lite information kring <?php echo $rubrik; ?>."/>
<meta name="robots" content="follow,index"/> <meta name="googlebot" content="index, follow"/> </head>
<body>
<h1><?php echo $rubrik; ?></h1> <p>Välkommen till <?php echo $rubrik; ?>.
</p> <p></p>
</body>
</html>