Redirection automatique vers nouvel hébergeur : BUG

bonjour

Je veux rediriger http://snec.cftc.acnantes.free.fr vers http://www.snec-cftc-acnantes.fr

J'ai placé le code suivant :

<?php
     header("Status: 301 Moved Permanently");
     header("Location: http://www.snec-cftc-acnantes.fr");
?>

Mais ca bug ! Et j'ai essayé pas mal de variantes !!!

qu'est ce qui ne marche pas ?

Voici un code d'erreur :

Warning: Cannot modify header information - headers already sent by (output started at /mnt/165/sdb/4/3/snec.cftc.acnantes/index.php:2) in /mnt/165/sdb/4/3/snec.cftc.acnantes/index.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /mnt/165/sdb/4/3/snec.cftc.acnantes/index.php:2) in /mnt/165/sdb/4/3/snec.cftc.acnantes/index.php on line 4

Comme l’indique le message d’erreur, la ligne 2 du script a déjà généré quelque chose (output), avant la fonction header().
Ca peut être des données, ou simplement des espaces, ou même souvent un simple saut de ligne.
Ici, plus précisément, puisque les messages citent l’erreur en lignes 3 et 4, j’imagine que ce sont justement les deux header() : la ligne 2 est donc celle qui contient « <?php », et il existe forcément une ligne 1, qui n’a aucune raison d’être.
C’est cette ligne 1 qu’il faut éliminer, même si elle est vide.

----- Original Message -----
From: Ramsess
To: spip@rezo.net
Sent: Sunday, July 12, 2009 9:02 PM
Subject: [Spip] Redirection automatique vers nouvel hébergeur : BUG

bonjour

Je veux rediriger http://snec.cftc.acnantes.free.fr vers
http://www.snec-cftc-acnantes.fr

J’ai placé le code suivant :

<?php header("Status: 301 Moved Permanently"); header("Location: [http://www.snec-cftc-acnantes.fr](http://www.snec-cftc-acnantes.fr)"); ?>

Mais ca bug ! Et j’ai essayé pas mal de variantes !!!

qu’est ce qui ne marche pas ?

Voici un code d’erreur :

Warning: Cannot modify header information - headers already sent by
(output started at /mnt/165/sdb/4/3/snec.cftc.acnantes/index.php:2) in
/mnt/165/sdb/4/3/snec.cftc.acnantes/index.php on line 3

Warning: Cannot modify header information - headers already sent by
(output started at /mnt/165/sdb/4/3/snec.cftc.acnantes/index.php:2) in
/mnt/165/sdb/4/3/snec.cftc.acnantes/index.php on line 4


liste spip
spip@rezo.net - désabonnement : envoyer un mail à spip-off@rezo.net

Infos et archives : http://listes.rezo.net/mailman/listinfo/spip
http://archives.rezo.net/spip.mbox/

Documentation de SPIP : http://www.spip.net/

Irc : de l’aide à toute heure : http://spip.net/irc