Bonjour à tous,
Je suppose que beaucoup de personnes ont le meme problème que moi , ou un problème similaire. Voilà, je m'explique, mon site web est bien référencé par yahoo, (avec 2 mots clefs) mais pas dans google. Cela fait 3 mois qu'il est en ligne... donc, je me pose quelques questions...
Le site est multilingue : donc, j'ai opté pour redirection vers un sous-dossier :
1) En fonction de la langue du browser : EX :
-----------------------------------------------------------------
$lang2 = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
$lang = explode(",",$lang2);
$lang = StrToLower(substr(chop($lang[0]),0,2));
switch ($lang) {
case "fr":
header('HTTP/1.1 301 Moved Permanently');
header('location:FR/index.php');
...
.... La meme chose pour le néérlandais.
.... La meme chose pour le default.
-----------------------------------------------------------------
2) En plus, dans cette meme page, mais je ne sais pas si ça se fait, j'ai rajouté une redirection HTML du genre :
-------------------------------------------------------
switch ($lang) {
case "fr":
echo '<meta http-equiv="refresh" content="0; url=http://***********"/>';
---------------------------------------------------------
Pour ceux que ça intéresse, j'ai mis l'adresse du site ici :
-http://www.***********/ //Heu, enlevé. ça faisait tache ds google
Mais etant donné la redirection du site, il est impossible "d'intercepter" le fichier de redirection. (Donc, je vous fait un gros copier, coller de celui-ci, ci-dessous... Si ça ne dérange personne, sinon, je fais un lien vers un fichier texte si vous préférez........ lol...
Rem : j'ai volontairement racourci et supprimé les mots clefs.
Merci de votre aide!
FICHIER -http://**********/index.php
------------------------------------------------------------------
<?php
$lang2 = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
$lang = explode(",",$lang2);
$lang = StrToLower(substr(chop($lang[0]),0,2));
switch ($lang) {
case "fr":
header('HTTP/1.1 301 Moved Permanently');
header('location:FR/index.php');
break;
case "nl":
header('HTTP/1.1 301 Moved Permanently');
header('location:NL/index.php');
break;
default:
header('HTTP/1.1 301 Moved Permanently');
header('location:FR/index.php');
}
?>
<?php
header('Content-Type: text/html; charset=ISO-8859-1');
header('Connection: close');
echo '<', '?', 'xml version="1.0" encoding="ISO-8859-1"?>'; //entête XML pour ISO-8859-1
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> ...</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<?php
switch ($lang) {
case "fr":
echo '<meta http-equiv="refresh" content="0; url=http://www.**********/FR/index.php"/>';
break;
case "nl":
echo '<meta http-equiv="refresh" content="0; url=http://www.************/NL/index.php"/>';
break;
default:
echo '<meta http-equiv="refresh" content="0; url=http://www.**********/FR/index.php"/>';
}
?>
<META NAME="robots" content="index,follow" />
<META NAME="Keywords" CONTENT="........">
<META NAME="description"CONTENT="........">
<META NAME="author" CONTENT=".........">
</head>
<body>
<?php
echo '<p><a href="http://www.**********/FR/index.php">***** en français</a></p>';
echo '<p><a href="http://www.**********/NL/index.php">***** in het Nederlands</a></p>';
?>
</body>
</html>
Je suppose que beaucoup de personnes ont le meme problème que moi , ou un problème similaire. Voilà, je m'explique, mon site web est bien référencé par yahoo, (avec 2 mots clefs) mais pas dans google. Cela fait 3 mois qu'il est en ligne... donc, je me pose quelques questions...
Le site est multilingue : donc, j'ai opté pour redirection vers un sous-dossier :
1) En fonction de la langue du browser : EX :
-----------------------------------------------------------------
$lang2 = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
$lang = explode(",",$lang2);
$lang = StrToLower(substr(chop($lang[0]),0,2));
switch ($lang) {
case "fr":
header('HTTP/1.1 301 Moved Permanently');
header('location:FR/index.php');
...
.... La meme chose pour le néérlandais.
.... La meme chose pour le default.
-----------------------------------------------------------------
2) En plus, dans cette meme page, mais je ne sais pas si ça se fait, j'ai rajouté une redirection HTML du genre :
-------------------------------------------------------
switch ($lang) {
case "fr":
echo '<meta http-equiv="refresh" content="0; url=http://***********"/>';
---------------------------------------------------------
Pour ceux que ça intéresse, j'ai mis l'adresse du site ici :
-http://www.***********/ //Heu, enlevé. ça faisait tache ds google
Mais etant donné la redirection du site, il est impossible "d'intercepter" le fichier de redirection. (Donc, je vous fait un gros copier, coller de celui-ci, ci-dessous... Si ça ne dérange personne, sinon, je fais un lien vers un fichier texte si vous préférez........ lol...
Rem : j'ai volontairement racourci et supprimé les mots clefs.
Merci de votre aide!
FICHIER -http://**********/index.php
------------------------------------------------------------------
<?php
$lang2 = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
$lang = explode(",",$lang2);
$lang = StrToLower(substr(chop($lang[0]),0,2));
switch ($lang) {
case "fr":
header('HTTP/1.1 301 Moved Permanently');
header('location:FR/index.php');
break;
case "nl":
header('HTTP/1.1 301 Moved Permanently');
header('location:NL/index.php');
break;
default:
header('HTTP/1.1 301 Moved Permanently');
header('location:FR/index.php');
}
?>
<?php
header('Content-Type: text/html; charset=ISO-8859-1');
header('Connection: close');
echo '<', '?', 'xml version="1.0" encoding="ISO-8859-1"?>'; //entête XML pour ISO-8859-1
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> ...</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<?php
switch ($lang) {
case "fr":
echo '<meta http-equiv="refresh" content="0; url=http://www.**********/FR/index.php"/>';
break;
case "nl":
echo '<meta http-equiv="refresh" content="0; url=http://www.************/NL/index.php"/>';
break;
default:
echo '<meta http-equiv="refresh" content="0; url=http://www.**********/FR/index.php"/>';
}
?>
<META NAME="robots" content="index,follow" />
<META NAME="Keywords" CONTENT="........">
<META NAME="description"CONTENT="........">
<META NAME="author" CONTENT=".........">
</head>
<body>
<?php
echo '<p><a href="http://www.**********/FR/index.php">***** en français</a></p>';
echo '<p><a href="http://www.**********/NL/index.php">***** in het Nederlands</a></p>';
?>
</body>
</html>