{"id":957,"date":"2025-03-30T11:50:24","date_gmt":"2025-03-30T11:50:24","guid":{"rendered":"https:\/\/fr.hopeuni.com\/?p=892"},"modified":"2026-01-15T16:50:14","modified_gmt":"2026-01-15T16:50:14","slug":"236-www-ou-pas-www-redirection-de-domaine","status":"publish","type":"post","link":"https:\/\/richpravda.com\/fr\/236-www-ou-pas-www-redirection-de-domaine\/","title":{"rendered":"236. Www ou pas www ? (Redirection de domaine)"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Redirection et Domaines : \ud83d\udc49 Comment rediriger ton site sans www vers le www (et \u00e9viter que ton domaine parte en vacances sans toi \ud83d\ude05)<\/h1>\n\n\n\n<p><\/p>\n\n\n\n<p>\ud83e\uddd1\u200d\ud83d\udcbb T\u2019as achet\u00e9 ton domaine comme un boss \ud83d\udcbc<br>\ud83c\udf10 Tu veux que \u00e7a fasse pro, genre <code>https:\/\/www.mondomaine.com<\/code><br>\ud83d\ude44 Mais y\u2019a un souci : quand on tape <code>https:\/\/mondomaine.com<\/code>&#8230;<br>\ud83d\udca5 BOUM ! Page blanche, erreur, ou pire\u2026 ton site se perd dans les limbes d&rsquo;internet \ud83d\ude31<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Rassure-toi. On va r\u00e9gler \u00e7a ensemble, proprement, rapidement, et avec style \ud83d\ude0e<\/h3>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">1. \ud83d\udcac Le dilemme du www : gadget ou passage oblig\u00e9 ?<\/h2>\n\n\n\n<p>Tu crois que <strong>le www est has-been ?<\/strong><br>\ud83d\udc49 Peut-\u00eatre. Mais <strong>Google, ton h\u00e9bergeur, et la moiti\u00e9 de l\u2019univers s\u2019en foutent pas mal.<\/strong><br>Ce qui compte, c\u2019est que <strong>ton site soit coh\u00e9rent<\/strong> \ud83e\udded<\/p>\n\n\n\n<p>Et surtout, que <strong>l\u2019internaute arrive au bon endroit<\/strong>, qu\u2019il tape :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>https:\/\/www.mondomaine.com<\/code> \u2705<\/li>\n\n\n\n<li><code>https:\/\/mondomaine.com<\/code> \u2705 aussi !<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Le but : tout doit rediriger vers la version avec <strong>www<\/strong>. \ud83d\udea6<\/h3>\n\n\n\n<p>Pourquoi ? Parce que sinon :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\ud83d\ude21 Ton r\u00e9f\u00e9rencement se divise (Google n\u2019aime pas les doublons)<\/li>\n\n\n\n<li>\ud83e\udd2f Tes cookies se perdent<\/li>\n\n\n\n<li>\ud83e\uddc3Et \u00e7a casse ton branding (tu veux quand m\u00eame que \u00e7a sente le s\u00e9rieux, non ?)<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2. \ud83d\udee0\ufe0f \u00c9tape 1 : cr\u00e9e un fichier <code>.htaccess<\/code> magique \u2728<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udccdVa dans ton <strong>cPanel &gt; Gestionnaire de fichiers &gt; Dossier racine du domaine<\/strong> (<code>public_html\/mondomaine.com<\/code>)<\/h3>\n\n\n\n<p>Ajoute ce petit bijou de code :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apacheCopyEdit<code>RewriteEngine On\n\nRewriteCond %{HTTP_HOST} ^mondomaine\\.com [NC]\nRewriteRule ^(.*)$ https:\/\/www.mondomaine.com\/$1 [L,R=301]\n<\/code><\/pre>\n\n\n\n<p>\ud83e\uddd9\u200d\u2642\ufe0f Traduction :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u00ab\u00a0Si quelqu\u2019un tape <strong>sans le www<\/strong>, redirige-le tout droit vers le royaume sacr\u00e9 du <strong>www<\/strong>.\u00a0\u00bb<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\ud83d\udea8 Attention : faut que ton <strong>SSL soit actif<\/strong> (Let\u2019s Encrypt, on te voit \ud83d\udc40)<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3. \ud83d\udcbe \u00c9tape 2 : ajoute un <code>index.html<\/code> de secours (parce qu\u2019on est jamais trop prudent)<\/h2>\n\n\n\n<p>Oui, oui, m\u00eame si <code>.htaccess<\/code> fait d\u00e9j\u00e0 le taf.<\/p>\n\n\n\n<p>\ud83e\uddde Voici le fichier que tu vas coller dans le <strong>m\u00eame dossier<\/strong> :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">htmlCopyEdit<code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"fr\"&gt;\n  &lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta http-equiv=\"refresh\" content=\"0; url=https:\/\/www.mondomaine.com\"&gt;\n    &lt;script&gt;\n      window.location.href = \"https:\/\/www.mondomaine.com\";\n    &lt;\/script&gt;\n    &lt;title&gt;Redirection...&lt;\/title&gt;\n  &lt;\/head&gt;\n  &lt;body&gt;\n    &lt;p&gt;Tu vas \u00eatre redirig\u00e9. Sinon, &lt;a href=\"https:\/\/www.mondomaine.com\"&gt;clique ici&lt;\/a&gt;.&lt;\/p&gt;\n  &lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n\n\n\n<p>\ud83d\udedf Pourquoi ce fichier ?<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Pour les robots, les navigateurs t\u00eatus ou si Apache fait une pause caf\u00e9 \u2615.<\/p>\n<\/blockquote>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">4. \ud83e\uddea \u00c9tape 3 : teste comme un hacker (ou un vieux prof de techno)<\/h2>\n\n\n\n<p>Ouvre un <strong>navigateur priv\u00e9<\/strong>, tape simplement :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">arduinoCopyEdit<code>https:\/\/mondomaine.com\n<\/code><\/pre>\n\n\n\n<p>Tu dois arriver, comme par magie, sur :<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">arduinoCopyEdit<code>https:\/\/www.mondomaine.com\n<\/code><\/pre>\n\n\n\n<p>Si c\u2019est le cas \ud83d\udc49 TU ES UN G\u00c9NIE \ud83d\udca1<br>Sinon\u2026 tu as oubli\u00e9 une virgule, un slash, ou ton chat a march\u00e9 sur ton clavier \ud83d\udc31\u2328\ufe0f<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83e\udde0 Tips bonus de l\u2019\u00e9lite du web :<\/h2>\n\n\n\n<p>\u2705 Pense \u00e0 v\u00e9rifier que <strong>les deux versions<\/strong> de ton site sont bien couvertes par un certificat SSL (HTTPS)<br>\u2705 Utilise <a class=\"\" href=\"https:\/\/www.redirect-checker.org\/\">https:\/\/www.redirect-checker.org\/<\/a> pour voir si ta redirection est clean \ud83d\udcaa<br>\u2705 Mets en cache ton <code>.htaccess<\/code> (ou vide le cache de ton navigateur) si tu ne vois pas les changements tout de suite<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd01 Tu veux forcer tout le monde vers HTTPS <strong>ET<\/strong> www ? Voici le <code>.htaccess<\/code> ultime :<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">apacheCopyEdit<code>RewriteEngine On\n\nRewriteCond %{HTTPS} off [OR]\nRewriteCond %{HTTP_HOST} !^www\\. [NC]\nRewriteRule ^ https:\/\/www.mondomaine.com%{REQUEST_URI} [L,R=301]\n<\/code><\/pre>\n\n\n\n<p>\ud83d\udca3 Et l\u00e0 t\u2019es officiellement <strong>le roi de la config serveur<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83c\udf89 Pour terminer :<\/h2>\n\n\n\n<p>\u27a1\ufe0f Ce petit d\u00e9tail technique a l\u2019air de rien\u2026 mais il change tout \ud83d\udca5<br>\ud83d\udc49 Tu renvoies une image <strong>pro<\/strong>, <strong>solide<\/strong>, <strong>optimis\u00e9e<\/strong>.<br>Et Google te fait un clin d\u2019\u0153il complice \ud83d\ude0f<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\ud83c\udf81 Et si tu veux d&rsquo;autres tutos pratiques, simples et styl\u00e9s, viens faire un tour sur \ud83d\udc49 <a class=\"\" href=\"https:\/\/hopeuni.com\">https:\/\/hopeuni.com<\/a> \ud83d\udca1<\/p>\n\n\n\n<p>On parle de sites, de blogs, de business, d\u2019optimisation\u2026 et m\u00eame de comment transformer une ligne de code en source de revenus passifs \ud83d\ude80\u2728<br>Tu y trouveras aussi des articles exclusifs sur le marketing, la strat\u00e9gie web, la tech, et bien plus encore.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>T&rsquo;as lu tout cela ?<br>Wahou !<\/p>\n\n\n\n<p>On t&rsquo;offre un cadeau de ouf gratuit, si tu cliques sur le lien ci-dessous : <\/p>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-16018d1d wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-75\"><a class=\"wp-block-button__link has-large-font-size has-custom-font-size wp-element-button\" href=\"https:\/\/masterskillflix.com\/fr\/programme-decouverte-gratuit\/\" style=\"border-top-left-radius:18px;border-top-right-radius:18px;border-bottom-left-radius:18px;border-bottom-right-radius:18px\">\ud83d\udc49\ud83c\udffb Clic \ud83c\udf81 On t&rsquo;offre un cadeau \ud83c\udf81 gratuit \ud83c\udd93 <\/a><\/div>\n<\/div>\n\n\n\n<p class=\"has-text-align-center\"><a href=\"https:\/\/masterskillflix.com\/fr\/programme-decouverte-gratuit\/\" target=\"_blank\" rel=\"noopener\">https:\/\/masterskillflix.com\/fr\/programme-decouverte-gratuit\/ <\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Redirection et Domaines : \ud83d\udc49 Comment rediriger ton site sans www vers le www (et \u00e9viter que ton domaine parte en vacances sans toi \ud83d\ude05) \ud83e\uddd1\u200d\ud83d\udcbb T\u2019as achet\u00e9 ton domaine comme un boss \ud83d\udcbc\ud83c\udf10 Tu veux que \u00e7a fasse pro, genre https:\/\/www.mondomaine.com\ud83d\ude44 Mais y\u2019a un souci : quand on tape https:\/\/mondomaine.com&#8230;\ud83d\udca5 BOUM ! Page blanche, &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/richpravda.com\/fr\/236-www-ou-pas-www-redirection-de-domaine\/\">Lire la suite<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"categories":[70],"tags":[],"class_list":["post-957","post","type-post","status-publish","format-standard","hentry","category-divers","item-wrap"],"_links":{"self":[{"href":"https:\/\/richpravda.com\/fr\/wp-json\/wp\/v2\/posts\/957","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/richpravda.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/richpravda.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/richpravda.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/richpravda.com\/fr\/wp-json\/wp\/v2\/comments?post=957"}],"version-history":[{"count":1,"href":"https:\/\/richpravda.com\/fr\/wp-json\/wp\/v2\/posts\/957\/revisions"}],"predecessor-version":[{"id":1763,"href":"https:\/\/richpravda.com\/fr\/wp-json\/wp\/v2\/posts\/957\/revisions\/1763"}],"wp:attachment":[{"href":"https:\/\/richpravda.com\/fr\/wp-json\/wp\/v2\/media?parent=957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/richpravda.com\/fr\/wp-json\/wp\/v2\/categories?post=957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/richpravda.com\/fr\/wp-json\/wp\/v2\/tags?post=957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}