Dotclear

Vous n'êtes pas identifié(e).

Annonce

13 février 2024 Sortie de Dotclear 2.29

#1 2011-09-02 17:49:47

Jean-Michel
Modérateur à ailes d'ange
Lieu : Paris
Inscription : 2006-08-22
Site Web

Comment faire une belle redirection ?

Bonsoir,

L'ancienne version d'un de mes sites se trouve à cette adresse (http://www.jm-royer.com/shine) et j'ai fait une nouvelle version que je rends accessible à une autre adresse (http://www.carolefredericks.fr). Les URL n'ont + rien à avoir.

Comment puis-je faire une redirection sur l'ancien emplacement vers le nouveau de façon correcte pour les différents moteurs de recherches et les visiteurs qui auraient garder l'ancienne URL en signet ?

- Merci.

Hors ligne

#2 2011-09-02 23:19:29

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : Comment faire une belle redirection ?

Tu peux faire une redirection permanente seulement si la structure de tes urls n'a pas changé, c'est à dire si la page http://www.jm-royer.com/shine/quelquechose a été transformée en http://www.carolefredericks.fr/quelquechose

Dans ce cas, un fichier .htaccess dans http://www.jm-royer.com/shine/ avec

RedirectPermanent / http://www.carolefredericks.fr/

devrait faire l'affaire

Hors ligne

#3 2011-09-04 15:23:57

Jean-Michel
Modérateur à ailes d'ange
Lieu : Paris
Inscription : 2006-08-22
Site Web

Re : Comment faire une belle redirection ?

Je dois avoir louper quelque chose car j'obtiens une 500 quand j'applique :

RedirectPermanent http://jm-royer.com/shine/francais/famille/erickbenzi.htm http://www.carolefredericks.fr/post/erick-benzi

RedirectPermanent http://jm-royer.com/shine/francais/famille/gildasarzel.htm http://www.carolefredericks.fr/post/gildas-arzel

RedirectPermanent http://jm-royer.com/shine/francais/famille/jacquesveneruso.htm http://www.carolefredericks.fr/post/jacques-veneruso

RedirectPermanent http://jm-royer.com/shine/francais/famille/taj-mahal.htm http://www.carolefredericks.fr/post/taj-mahal

RedirectPermanent http://jm-royer.com/shine/english/famille/taj-mahal.htm http://www.carolefredericks.fr/post/taj-mahal

RedirectPermanent http://jm-royer.com/shine/francais/famille/goldman.htm http://www.carolefredericks.fr/post/jean-jacques-goldman

RedirectPermanent http://jm-royer.com/shine/francais/hommage/hommage.htm
http://www.carolefredericks.fr/post/hommages-tribute

RedirectPermanent http://jm-royer.com/shine/francais/presse/itw_shine.htm
http://www.carolefredericks.fr/post/interview-shine-carole-fredericks

RedirectPermanent http://jm-royer.com/shine/francais/discographie/blackorchid.htm
http://www.carolefredericks.fr/post/black-orchid

RedirectPermanent http://jm-royer.com/shine/francais/discographie/springfield.htm
http://www.carolefredericks.fr/post/springfield

RedirectPermanent
http://jm-royer.com/shine/english/discography/springfield.htm
http://www.carolefredericks.fr/post/springfield

RedirectPermanent
http://jm-royer.com/shine/francais/discographie/couleursetparfums.htm
http://www.carolefredericks.fr/post/couleurs-et-parfums

RedirectPermanent
http://jm-royer.com/shine/english/discographie/couleursetparfums.htm
http://www.carolefredericks.fr/post/couleurs-et-parfums

RedirectPermanent
http://jm-royer.com/shine/francais/discographie/choriste.htm
http://www.carolefredericks.fr/category/discographie

RedirectPermanent
http://jm-royer.com/shine/francais/discographie/discographie.htm
http://www.carolefredericks.fr/category/discographie

RedirectPermanent
http://jm-royer.com/shine/francais/biographie/biographie.htm
http://www.carolefredericks.fr/category/biographie

RedirectPermanent
http://jm-royer.com/shine/english/biography/biography.htm
http://www.carolefredericks.fr/category/biographie

RedirectPermanent
http://jm-royer.com/shine/francais/liens/liens.htm
http://www.carolefredericks.fr/category/liens

Hors ligne

#4 2011-09-04 16:45:41

pierrevg
Membre
Inscription : 2005-04-13
Site Web

Re : Comment faire une belle redirection ?

Si tu es chez 1&1, il est vivement conseillé d'encoder en ANSI et surtout pas en UTF8 les .htaccess.

Hors ligne

#5 2011-09-04 19:02:23

Jean-Michel
Modérateur à ailes d'ange
Lieu : Paris
Inscription : 2006-08-22
Site Web

Re : Comment faire une belle redirection ?

pierrevg a écrit :

Si tu es chez 1&1, il est vivement conseillé d'encoder en ANSI et surtout pas en UTF8 les .htaccess.

Sauf que pour le moment, je ne trouve pas d'éditeur sur Mac qui le propose :-(

Hors ligne

#6 2011-09-04 19:20:59

Kozlika
Modo dcTeam
Inscription : 2004-05-08
Site Web

Re : Comment faire une belle redirection ?

Iso Latin 1


La documentation : http://doc.dotclear.net/2.0/fulltoc
Le module de recherche du forum : http://www.dotclear.net/forum/search.php ?

Hors ligne

#7 2011-09-04 19:25:58

Jean-Michel
Modérateur à ailes d'ange
Lieu : Paris
Inscription : 2006-08-22
Site Web

Re : Comment faire une belle redirection ?

Kozlika a écrit :

Iso Latin 1

TextMate me le propose mais à nouveau Error 500.

Hors ligne

#8 2011-09-04 19:33:49

Kozlika
Modo dcTeam
Inscription : 2004-05-08
Site Web

Re : Comment faire une belle redirection ?

Etrange… Tu as réencodé un fichier existant ou créé un nouveau ?


La documentation : http://doc.dotclear.net/2.0/fulltoc
Le module de recherche du forum : http://www.dotclear.net/forum/search.php ?

Hors ligne

#9 2011-09-04 19:58:49

Jean-Michel
Modérateur à ailes d'ange
Lieu : Paris
Inscription : 2006-08-22
Site Web

Re : Comment faire une belle redirection ?

J'ai fini par en recréer un nouveau, okay plus d'erreurs 500 mais la redirection ne fonctionne toujours pas :'(

Hors ligne

#10 2011-09-04 20:57:05

patidou
Membre
Inscription : 2004-11-14
Site Web

Re : Comment faire une belle redirection ?

Les urls de la source doivent être relatives et pas absolues ;-)


«Quand j'étais petit, je voulais être maître du monde. Maintenant que je suis grand, j'arrive à peine à être maître de moi-même.» Le Chat/Philippe Geluk.
Dotclear a besoin de vous

Hors ligne

#11 2011-09-05 07:30:02

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : Comment faire une belle redirection ?

Pour préciser un peu la remarque (tout à fait juste) de patidou : dans le répertoire

http://jm-royer.com/shine/francais/discographie/

tu mets le .htaccess suivant :

RedirectPermanent    /discographie.htm    http://www.carolefredericks.fr/category/discographie
RedirectPermanent    /couleursetparfums.htm    http://www.carolefredericks.fr/post/couleurs-et-parfums
etc.

sans aller à la ligne au milieu d'une règle ^^, et tu fais de même dans tous les répertoires contenant des adresses à rediriger

Si en revanche le .htaccess est à la racine de jm-royer.com, les règles de réécriture y seront toutes, et sous cette forme :

RedirectPermanent    /shine/francais/discographie.htm    http://www.carolefredericks.fr/category/discographie
etc.

(rapidement, il me semble toutefois que tout cela aurait pu être réalisé avec 3 ou 4 réécritures d'URLs...)

Hors ligne

#12 2011-09-05 07:58:28

Jean-Michel
Modérateur à ailes d'ange
Lieu : Paris
Inscription : 2006-08-22
Site Web

Re : Comment faire une belle redirection ?

Merci des précisions. Je viens de mettre le .htaccess comme tu me le recommandes mais cela n'a aucun effet (de redirection)

Je précise que c'est pour garder les URL déjà référencés et référencer facilement les nouvelles.

Dernière modification par Jean-Michel (2011-09-05 08:02:13)

Hors ligne

#13 2011-09-05 09:29:24

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : Comment faire une belle redirection ?

euh... une redirection permanente est faite pour indiquer, par une réponse HTTP 301, que l'adresse demandée a changé définitivement, et permet en outre de renvoyer le visiteur vers la nouvelle. Autrement dit, l'ancienne adresse n'est plus disponible, hein...

Hors ligne

#14 2011-09-05 09:44:04

Jean-Michel
Modérateur à ailes d'ange
Lieu : Paris
Inscription : 2006-08-22
Site Web

Re : Comment faire une belle redirection ?

amalgame a écrit :

euh... une redirection permanente est faite pour indiquer, par une réponse HTTP 301, que l'adresse demandée a changé définitivement, et permet en outre de renvoyer le visiteur vers la nouvelle. Autrement dit, l'ancienne adresse n'est plus disponible, hein...

Désolé mais je suis totalement perdu…

J'ai fait ce que tu me demandais et si je saisis l'ancienne adresse, elle est toujours visible et ne redirige pas. Est-ce que les anciens fichiers doivent être supprimés pour que cela fonctionne ?

Hors ligne

#15 2011-09-05 10:06:09

patidou
Membre
Inscription : 2004-11-14
Site Web

Re : Comment faire une belle redirection ?

Je ne comprends pas bien pourquoi il faudrait un htaccess par répertoire, ceci :

RedirectPermanent /shine/francais/famille/erickbenzi.htm http://www.carolefredericks.fr/post/erick-benzi

RedirectPermanent /shine/francais/famille/gildasarzel.htm http://www.carolefredericks.fr/post/gildas-arzel

RedirectPermanent /shine/francais/famille/jacquesveneruso.htm http://www.carolefredericks.fr/post/jacques-veneruso

RedirectPermanent /shine/francais/famille/taj-mahal.htm http://www.carolefredericks.fr/post/taj-mahal

RedirectPermanent /shine/english/famille/taj-mahal.htm http://www.carolefredericks.fr/post/taj-mahal

RedirectPermanent /shine/francais/famille/goldman.htm http://www.carolefredericks.fr/post/jean-jacques-goldman

RedirectPermanent /shine/francais/hommage/hommage.htm http://www.carolefredericks.fr/post/hommages-tribute

RedirectPermanent /shine/francais/presse/itw_shine.htm http://www.carolefredericks.fr/post/interview-shine-carole-fredericks

RedirectPermanent /shine/francais/discographie/blackorchid.htm http://www.carolefredericks.fr/post/black-orchid

RedirectPermanent /shine/francais/discographie/springfield.htm http://www.carolefredericks.fr/post/springfield

RedirectPermanent /shine/english/discography/springfield.htm http://www.carolefredericks.fr/post/springfield

RedirectPermanent /shine/francais/discographie/couleursetparfums.htm http://www.carolefredericks.fr/post/couleurs-et-parfums

RedirectPermanent /shine/english/discographie/couleursetparfums.htm http://www.carolefredericks.fr/post/couleurs-et-parfums

RedirectPermanent /shine/francais/discographie/choriste.htm http://www.carolefredericks.fr/category/discographie

RedirectPermanent /shine/francais/discographie/discographie.htm http://www.carolefredericks.fr/category/discographie

RedirectPermanent /shine/francais/biographie/biographie.htm http://www.carolefredericks.fr/category/biographie

RedirectPermanent /shine/english/biography/biography.htm http://www.carolefredericks.fr/category/biographie

RedirectPermanent /shine/francais/liens/liens.htm http://www.carolefredericks.fr/category/liens

…à la racine ne marcherait pas?


«Quand j'étais petit, je voulais être maître du monde. Maintenant que je suis grand, j'arrive à peine à être maître de moi-même.» Le Chat/Philippe Geluk.
Dotclear a besoin de vous

Hors ligne

#16 2011-09-05 10:15:59

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : Comment faire une belle redirection ?

patidou a écrit :

Je ne comprends pas bien pourquoi il faudrait un htaccess par répertoire,
…à la racine ne marcherait pas?

Sissi, c'était bien ce que j'avais signalé, c'était pour illustrer le fait que le premier argument était une adresse relative à l'emplacement du .htaccess ;)

Hors ligne

#17 2011-09-05 10:17:59

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : Comment faire une belle redirection ?

Jean-Michel a écrit :

J'ai fait ce que tu me demandais et si je saisis l'ancienne adresse, elle est toujours visible et ne redirige pas

Nous sommes bien d'accord qu'à la racine de http://jm-royer.com/ tu as le .htaccess proposé par patidou ?

Hors ligne

#18 2011-09-05 10:50:49

Jean-Michel
Modérateur à ailes d'ange
Lieu : Paris
Inscription : 2006-08-22
Site Web

Re : Comment faire une belle redirection ?

1 - Je viens de supprimer le .htaccess présent dans shine/francais/discographie
2 - Je viens de modifier mon .htaccess présent à la racine de mon hébergement chez 1&1 en insérant le code donné en #15
3 - Toujours pareil…

Je renouvelle ma question : Est-ce que les anciens fichiers doivent être supprimés pour que cela fonctionne ?

Hors ligne

#19 2011-09-05 11:03:05

patidou
Membre
Inscription : 2004-11-14
Site Web

Re : Comment faire une belle redirection ?

Non il ne faut pas les supprimer. ;)

C'est bizarre ton problème…


«Quand j'étais petit, je voulais être maître du monde. Maintenant que je suis grand, j'arrive à peine à être maître de moi-même.» Le Chat/Philippe Geluk.
Dotclear a besoin de vous

Hors ligne

#20 2011-09-05 11:17:30

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : Comment faire une belle redirection ?

Essaie (avec une seule ligne pour commencer), en supprimant le premier slash :

RedirectPermanent shine/francais/famille/erickbenzi.htm http://www.carolefredericks.fr/post/erick-benzi

(il me semble n'est obligatoire que sur certains serveurs ?)

Hors ligne

#21 2011-09-05 11:32:22

Jean-Michel
Modérateur à ailes d'ange
Lieu : Paris
Inscription : 2006-08-22
Site Web

Re : Comment faire une belle redirection ?

Pas mieux, amalgame. Au pire, j'attends que le référencement du nouvel emplacement se fasse (ça a commencé).

Hors ligne

#22 2011-09-05 12:09:49

patidou
Membre
Inscription : 2004-11-14
Site Web

Re : Comment faire une belle redirection ?

SInon tu peux faire ça en php si le htaccess ne marche pas…

Mais bon, c'est utiliser un bazooka pour tuer une mouche. ;-)


«Quand j'étais petit, je voulais être maître du monde. Maintenant que je suis grand, j'arrive à peine à être maître de moi-même.» Le Chat/Philippe Geluk.
Dotclear a besoin de vous

Hors ligne

#23 2011-09-05 14:15:49

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : Comment faire une belle redirection ?

Jean-Michel a écrit :

Pas mieux, amalgame.

L'arborescence /shine/francais/famille/ sur ton site correspond-elle à de vrais répertoires ? N'y aurait-il pas un autre fichier .htaccess à la racine du site ?

Hors ligne

#24 2011-09-05 16:04:20

Jean-Michel
Modérateur à ailes d'ange
Lieu : Paris
Inscription : 2006-08-22
Site Web

Re : Comment faire une belle redirection ?

amalgame a écrit :

L'arborescence /shine/francais/famille/ sur ton site correspond-elle à de vrais répertoires ?

Oui, absolument. L'ancienne version est faire avec des fichiers HTML et même sans feuille de style.

amalgame a écrit :

N'y aurait-il pas un autre fichier .htaccess à la racine du site ?

Non, c'est le seul. Voici ce qu'il contient :

AddType x-mapp-php5 .php

RedirectPermanent /angelcloud http://www.atelierdethemes.com/themes/post/angelcloud
RedirectPermanent /freedom http://www.atelierdethemes.com/themes/post/freedom
RedirectPermanent /springseason http://www.atelierdethemes.com/themes/post/springseason
RedirectPermanent /japonisant http://www.atelierdethemes.com/themes/post/japonisant
RedirectPermanent /opaline http://www.atelierdethemes.com/themes/post/opaline
RedirectPermanent /debra http://www.atelierdethemes.com/themes/post/debra
RedirectPermanent /letter http://www.atelierdethemes.com/themes/post/letter
RedirectPermanent /california http://www.atelierdethemes.com/themes/post/california
RedirectPermanent /nine http://www.atelierdethemes.com/themes/post/nine

RedirectPermanent /antares http://www.atelierdethemes.com/themes/antares
RedirectPermanent /boreal http://www.atelierdethemes.com/themes/boreal
RedirectPermanent /denebola http://www.atelierdethemes.com/themes/denebola
RedirectPermanent /gienna http://www.atelierdethemes.com/themes/gienna
RedirectPermanent /pistolstar http://www.atelierdethemes.com/themes/pistolstar
RedirectPermanent /polaris http://www.atelierdethemes.com/themes/polaris
RedirectPermanent /naos http://www.atelierdethemes.com/themes/naos
RedirectPermanent /replicant http://www.atelierdethemes.com/themes/replicant

RedirectPermanent shine/francais/famille/erickbenzi.htm http://www.carolefredericks.fr/post/erick-benzi
RedirectPermanent /shine/francais/famille/gildasarzel.htm http://www.carolefredericks.fr/post/gildas-arzel
RedirectPermanent /shine/francais/famille/jacquesveneruso.htm http://www.carolefredericks.fr/post/jacques-veneruso
RedirectPermanent /shine/francais/famille/taj-mahal.htm http://www.carolefredericks.fr/post/taj-mahal
RedirectPermanent /shine/english/famille/taj-mahal.htm http://www.carolefredericks.fr/post/taj-mahal
RedirectPermanent /shine/francais/famille/goldman.htm http://www.carolefredericks.fr/post/jean-jacques-goldman
RedirectPermanent /shine/francais/hommage/hommage.htm http://www.carolefredericks.fr/post/hommages-tribute
RedirectPermanent /shine/francais/presse/itw_shine.htm http://www.carolefredericks.fr/post/interview-shine-carole-fredericks
RedirectPermanent /shine/francais/discographie/blackorchid.htm http://www.carolefredericks.fr/post/black-orchid
RedirectPermanent /shine/francais/discographie/springfield.htm http://www.carolefredericks.fr/post/springfield
RedirectPermanent /shine/english/discography/springfield.htm http://www.carolefredericks.fr/post/springfield
RedirectPermanent /shine/francais/discographie/couleursetparfums.htm http://www.carolefredericks.fr/post/couleurs-et-parfums
RedirectPermanent /shine/english/discographie/couleursetparfums.htm http://www.carolefredericks.fr/post/couleurs-et-parfums
RedirectPermanent /shine/francais/discographie/choriste.htm http://www.carolefredericks.fr/category/discographie
RedirectPermanent /shine/francais/discographie/discographie.htm http://www.carolefredericks.fr/category/discographie
RedirectPermanent /shine/francais/biographie/biographie.htm http://www.carolefredericks.fr/category/biographie
RedirectPermanent /shine/english/biography/biography.htm http://www.carolefredericks.fr/category/biographie
RedirectPermanent /shine/francais/liens/liens.htm http://www.carolefredericks.fr/category/liens

RewriteEngine on
	RewriteBase /
	RewriteCond %{REQUEST_FILENAME} !-f 
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*)$ /blogs/home/$1 [L]
	RewriteRule ^$ /blogs/home/ [L]

RewriteEngine on
	RewriteBase /
	RewriteCond %{REQUEST_FILENAME} !-f 
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*)$ wld_domain/wld_gal/index.php?categories/Portfolio [L]
	RewriteRule ^$ wld_domain/wld_gal/index.php?meta/type/portfolio [L]

<FilesMatch "^\.">
    Order allow,deny
    Allow from all
</FilesMatch>
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
</FilesMatch>

Hors ligne

Vous n'êtes pas identifié(e).

Pied de page des forums

Sites map