Domaines - Migration de domaine - Redirection de l'ancien vers le nouveau (HTTPS inclus)
... / Migration de domaine - Re...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

Migration de domaine - Redirection de l'ancien vers le nouveau (HTTPS inclus)

Von
MD
Erstellungsdatum 2025-02-19 08:08:38 in Domaines

Bonjour,

J'ai récemment changé le nom de mon site Wordpress tout en conservant mon hébergement et ancien domaine mais j'ai un problème pour générer les bonnes redirections.

Voici le contexte :

OVH :

- hébergement + domaine olddomain.com (ancien domaine)

GoDaddy : - nouveau domaine newdomain.design

Pour passer de mon ancien domaine à mon nouveau, j'ai fais les configurations nécessaires sur Wordpress et les pointages DNS. Le site est bien fonctionnel sous le nouveau domaine.

En revanche, je ne parviens pas à rediriger mon ancien domaine vers le nouveau.

Voici ce que j'ai essayé :

- Utilisation de la fonction redirection sur le dashboard OVH

- Modification du fichier htaccess en rajoutant en première ligne le code suivant

# Début redirection 301

RewriteEngine On RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC,OR]

RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$ [NC]

RewriteRule ^(.*)$ https://newdomain.design/$1 [R=301,L,NC]

# Fin redirection 301

 

Pourriez-vous m'aider à faire en sorte que cette redirection fonctionne ? 

 

Merci !


1 Antwort ( Latest reply on 2025-02-19 11:03:32 Von
fritz2cat 🇧🇪 🇪🇺
)

Bonjour,

Il vous manque un retour à la ligne.

# Début redirection 301

RewriteEngine On RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC,OR]

RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$ [NC]

RewriteRule ^(.*)$ https://newdomain.design/$1 [R=301,L,NC]

# Fin redirection 301

 

devrait être

 

# Début redirection 301

RewriteEngine On

RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC,OR]

RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$ [NC]

RewriteRule ^(.*)$ https://newdomain.design/$1 [R=301,L,NC]

# Fin redirection 301