{"id":4568,"date":"2026-08-15T03:51:14","date_gmt":"2026-08-15T03:51:14","guid":{"rendered":"https:\/\/ownwebservers.com\/kb\/?p=4568"},"modified":"2026-08-15T03:51:16","modified_gmt":"2026-08-15T03:51:16","slug":"www-non-www-domains-ssl-certificate-redirect","status":"publish","type":"post","link":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/","title":{"rendered":"Using www and non-www domains with an SSL certificate"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Deciding whether your website lives at <code>example.com<\/code> or <code>www.example.com<\/code> is one of the oldest dilemmas on the web. While it might seem like a trivial preference, the choice carries significant technical and SEO implications once you introduce SSL certificates into the mix. Modern browsers display an explicit &#8220;Not Secure&#8221; warning for any page lacking a valid HTTPS connection, and if you aren&#8217;t careful, managing traffic between your www and non-www variants can inadvertently trigger those warnings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The challenge lies in the fact that search engines and web browsers treat the <code>www<\/code> and non-<code>www<\/code> versions of your domain as entirely separate entities. If both resolve to your server but only one is secured, or if they are not properly linked together, visitors might hit a security error wall before they ever see your homepage.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we will walk through the proper way to configure www non-www SSL setups, establish a 301 redirect canonical path, and ensure your visitors\u2014whether they type the prefix or not\u2014arrive safely at a single, encrypted destination.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding www vs non-www and SSL Certificate Coverage<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">From a DNS perspective, the root domain (<code>example.com<\/code>) and the www subdomain (<code>www.example.com<\/code>) are distinct records pointing at your server. To secure both, you cannot rely on a single-factor certificate. You must install an SSL certificate that explicitly covers both hostnames. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The Role of SAN and Let&#8217;s Encrypt<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Historically, securing multiple hostnames required complex configurations. Today, this is handled using a Subject Alternative Name (SAN) certificate. A SAN allows a single certificate to secure multiple domains or subdomains. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For most small business owners, the easiest way to achieve this is through Let&#8217;s Encrypt, which issues free SSL certificates. A standard Let&#8217;s Encrypt SAN certificate auto-provisions both the root domain and the www variant by default. By utilizing Let&#8217;s Encrypt, you ensure that regardless of which version a user types into their browser, a valid SSL\/TLS handshake can be established.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Preventing Mixed Content Warnings and Security Errors<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If your non-preferred hostname resolves but lacks SSL coverage, any visitor arriving via HTTPS on that specific variant will be greeted with a browser security error. Furthermore, if traffic is incorrectly forwarded over HTTPS to HTTP content, browsers will block elements on the page, resulting in mixed content warnings. Properly securing both variants is mandatory to establish trust, prevent malicious attacks like SSL stripping, and maintain a professional user experience.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring Permanent 301 Redirects for Canonical Hostnames<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once both variants are secured with an <strong><a href=\"https:\/\/ownwebservers.com\/ssl-certificates\" data-type=\"link\" data-id=\"https:\/\/ownwebservers.com\/ssl-certificates\" target=\"_blank\" rel=\"noreferrer noopener\">SSL certificates<\/a><\/strong>, your next step is to choose a canonical (primary) hostname. To prevent duplicate content SEO penalties, you must implement a permanent 301 redirect from your non-preferred hostname to your canonical preferred hostname.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is essential for consolidating page ranking signals. Search engines like Google allocate ranking signals (like backlinks) to specific URLs. If users link to both <code>example.com<\/code> and <code>www.example.com<\/code>, splitting your traffic means splitting your authority. A 301 redirect consolidates all of that ranking power onto a single domain.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Implementing Canonical Redirects on Apache and Nginx<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Apache RewriteEngine Rules for .htaccess and Server Configs<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In Apache environments, canonical redirects are efficiently handled using RewriteEngine rules in your .htaccess file or central server configuration. If your canonical domain is the non-www version, you would add the following to force all www traffic to the root domain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>RewriteEngine On\nRewriteCond %{HTTPS} off &#91;OR]\nRewriteCond %{HTTP_HOST} ^www.example.com &#91;NC]\nRewriteRule ^(.*)$ https:\/\/example.com\/$1 &#91;L,R=301]\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This rule checks if HTTPS is off or if the request included the www prefix, then issues a 301 redirect to the secure, non-www version. A similar rule can be inverted if you prefer the www variant as your primary.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Nginx Server Blocks for 301 Redirects to the Canonical Host<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Nginx administrators should configure separate server blocks for the non-primary hostname that return a 301 redirect to the canonical server block. This is highly efficient and processes incredibly fast. If your primary site is <code>www.example.com<\/code>, your Nginx configuration would look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    listen 443 ssl;\n    server_name example.com;\n    ssl_certificate \/path\/to\/fullchain.pem;\n    ssl_certificate_key \/path\/to\/privkey.pem;\n    return 301 https:\/\/www.example.com$request_uri;\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Note that even the non-canonical block must include the SSL certificate paths. If SSL is not configured on the redirecting block, browsers will throw a security error before the redirect can even execute.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Leveraging CDNs and Edge Redirects for SSL Termination<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you are utilizing a Content Delivery Network like Cloudflare, you can manage www versus non-www redirects before traffic ever hits your origin server. CDNs allow seamless SSL termination at the edge, meaning you can enforce Strict HTTPS and manage edge redirects natively from their dashboard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This setup significantly minimizes origin SSL CPU overhead on hosting options like shared hosting or a Managed VPS. The CDN handles the cryptographic math required for HTTPS handshakes for millions of visitors, passing only standard HTTP requests back to your origin server behind the scenes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Managing SSL AutoSSL in Hosting Control Panels<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you operate your business through control panels like cPanel or DirectAdmin, these platforms include an AutoSSL feature that handles certificates automatically. However, when migrating between preferred domains on managed infrastructure, you must verify that autoSSL generation covers the (sub)domain aliases you intend to redirect.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you set up a redirect but delete the DNS record or disable the alias in cPanel before AutoSSL renews the certificate, the redirect destination will break at renewal time. Always verify that both root domains and mapped subdomains are listed in the AutoSSL queue to prevent automated certificate renewal failures.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configuring Reverse Proxies and Load Balancers for HTTPS Traffic<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For dedicated servers and private cloud deployments utilizing reverse proxies like HAProxy or load balancers, offloading SSL to the proxy introduces a new challenge: the backend application needs to know if the original request was encrypted.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Passing the X-Forwarded-Proto Header<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You must ensure the <code>X-Forwarded-Proto<\/code> header is passed to the backend application. If your load balancer communicates with your application server over HTTP (port 80), but the original user connected over HTTPS (port 443), the backend might assume HTTP is being used. Without this header, frameworks like WordPress or Laravel will attempt to loop the 301 redirect indefinitely, resulting in an &#8220;ERR_TOO_MANY_REDIRECTS&#8221; error in the browser.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># HAProxy example for forwarding proto\nhttp-request set-header X-Forwarded-Proto https if { ssl_fc }\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Secure before you redirect:<\/strong> Always install valid SSL certificates covering both www and non-www variants before enforcing redirects to avoid locking users out of an unsecured endpoint.<\/li>\n\n\n\n<li><strong>Consolidate your DNS:<\/strong> Ensure DNS A records exist for both the root domain and the www subdomain, pointing to the same origin server or CDN IP.<\/li>\n\n\n\n<li><strong>Use Let&#8217;s Encrypt SANs:<\/strong> Take advantage of free Let&#8217;s Encrypt SAN capabilities to simultaneously secure multiple domain formats with a single certificate.<\/li>\n\n\n\n<li><strong>Mind your redirects on CDNs:<\/strong> When using Cloudflare or similar services, use edge rules or page rules for redirects to save Origin CPU resources.<\/li>\n\n\n\n<li><strong>HSTS implementation timing:<\/strong> Only configure HSTS headers once you are 100% certain that all domains and subdomains resolve correctly over HTTPS without certificate errors.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Symptom<\/th><th>Cause<\/th><th>Fix<\/th><\/tr><tr><td>ERR_TOO_MANY_REDIRECTS<\/td><td>Infinite redirect loop often caused by reverse proxy stripping HTTPS data.<\/td><td>Pass the <code>X-Forwarded-Proto<\/code> header from HAProxy\/Nginx\/Load Balancer to the backend application so it recognizes HTTPS origin requests.<\/td><\/tr><tr><td>&#8220;Not Secure&#8221; warning when typing www version<\/td><td>The SSL certificate only covers the root domain (Common Name) but lacks the www variant as a SAN.<\/td><td>Reissue\/re-request the Let&#8217;s Encrypt certificate with both <code>-d example.com -d www.example.com<\/code>, or add an Alias in cPanel AutoSSL settings.<\/td><\/tr><tr><td>Drop in SEO rankings during domain migration<\/td><td>Missing or temporary (302) redirect placed instead of permanent (301) redirect between canonical hostnames.<\/td><td>Ensure a strict HTTP <code>R=301<\/code> rule is applied in Apache\/Nginx for all non-canonical hostname variants to consolidate ranking signals.<\/td><\/tr><tr><td>HSTS cached after disabling site access<\/td><td>Browser cached an HSTS header but the origin certificate expired or was removed, locking out visitors.<\/td><td>Never issue HSTS until infrastructure is stable. Fix requires restoring valid HTTPS on all affected hostnames so browsers can reach the site again; there is no easy bypass for HSTS locally.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Making the choice between www and non-www is less about preference and more about strict, secure architecture. By utilizing a Let&#8217;s Encrypt SAN certificate to cover both variants, setting a permanent 301 redirect canonical structure, and correctly passing headers through any reverse proxies or CDNs, you guarantee that search engines view your site as a single entity and that users always land safely on an encrypted connection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once these systems are implemented carefully across your hosting environments\u2014whether utilizing <strong><a href=\"https:\/\/ownwebservers.com\/\" data-type=\"link\" data-id=\"https:\/\/ownwebservers.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">OwnWebServers<\/a><\/strong> managed cloud VPS platforms or dedicated infrastructure\u2014you can safely add HSTS to lock down your traffic permanently. Taking these steps transforms your domain handling from a potential security liability into a robust, SEO-friendly foundation for your business growth.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions<\/h2>\n\n\n\n<div class=\"wpcwp-faq\">\n<details class=\"wpcwp-faq-item\">\n<summary>Do I need a separate SSL certificate for www and non-www?<\/summary>\n<div class=\"wpcwp-faq-answer\">No, you do not need separate certificates. You should use a Subject Alternative Name (SAN) certificate or a Let&#8217;s Encrypt certificate, which automatically provisions and covers both the www and non-www variants of your domain under a single certificate.<\/div>\n<\/details>\n<details class=\"wpcwp-faq-item\">\n<summary>Why is a 301 redirect necessary for www vs non-www?<\/summary>\n<div class=\"wpcwp-faq-answer\">A permanent 301 redirect from your non-preferred hostname to your canonical preferred hostname is mandatory to prevent duplicate content SEO penalties and consolidate page ranking signals. It ensures visitors and search engines experience a single, consistent website.<\/div>\n<\/details>\n<details class=\"wpcwp-faq-item\">\n<summary>How do I implement canonical redirects in Apache and Nginx?<\/summary>\n<div class=\"wpcwp-faq-answer\">In Apache, use the RewriteEngine in your .htaccess file or server configuration to return a 301 redirect. In Nginx, configure separate server blocks for the non-primary hostname that return a 301 redirect to the canonical server block.<\/div>\n<\/details>\n<details class=\"wpcwp-faq-item\">\n<summary>When should I enable the HSTS header?<\/summary>\n<div class=\"wpcwp-faq-answer\">HTTP Strict Transport Security (HSTS) headers must only be applied after you have successfully installed valid SSL certificates for both hostname variants and established your 301 redirects. This prevents browsers from caching a forced HTTPS connection to an unsecured hostname version.<\/div>\n<\/details>\n<details class=\"wpcwp-faq-item\">\n<summary>How do I prevent infinite redirect loops behind a load balancer?<\/summary>\n<div class=\"wpcwp-faq-answer\">For reverse proxies or load balancers, ensure the X-Forwarded-Proto header is passed to the backend application. This allows the application to recognize HTTPS origin requests so it does not loop the 301 redirect indefinitely.<\/div>\n<\/details>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to configure www and non-www domains with SSL. Implement 301 redirects, secure SANs, manage HSTS, and prevent redirect loops on Apache, Nginx, and CDNs.<\/p>\n","protected":false},"author":1,"featured_media":4570,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"new-technologies","meta":{"footnotes":""},"categories":[22],"tags":[131,113,269],"class_list":["post-4568","post","type-post","status-publish","format-new-technologies","has-post-thumbnail","hentry","category-security","tag-apache","tag-nginx","tag-ssl-certificates","post_format-new-technologies"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>WWW vs Non-WWW: SSL &amp; 301 Redirect Config Guide<\/title>\n<meta name=\"description\" content=\"Learn how to configure www and non-www domains with SSL. Implement 301 redirects, secure SANs, manage HSTS, and prevent redirect loops on Apache, Nginx, and CDNs.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WWW vs Non-WWW: SSL &amp; 301 Redirect Config Guide\" \/>\n<meta property=\"og:description\" content=\"Master www vs non-www domain configurations with SSL. Discover best practices for 301 redirects, Let&#039;s Encrypt SANs, HSTS, and preventing redirect loops.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/\" \/>\n<meta property=\"og:site_name\" content=\"OWS KB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/OWN-WEB-SERVERS-107052961577434\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-15T03:51:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-15T03:51:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/08\/pexels-photo-51213.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1880\" \/>\n\t<meta property=\"og:image:height\" content=\"1248\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:description\" content=\"Configuring www vs non-www with SSL? Learn how to manage SANs, set up 301 redirects on Apache\/Nginx, enforce HSTS securely, and prevent infinite redirect loops.\" \/>\n<meta name=\"twitter:creator\" content=\"@OwnWebservers\" \/>\n<meta name=\"twitter:site\" content=\"@OwnWebservers\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/www-non-www-domains-ssl-certificate-redirect\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/www-non-www-domains-ssl-certificate-redirect\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#\\\/schema\\\/person\\\/4a40fe3fe17a08ddd1d7c113668e75f2\"},\"headline\":\"Using www and non-www domains with an SSL certificate\",\"datePublished\":\"2026-08-15T03:51:14+00:00\",\"dateModified\":\"2026-08-15T03:51:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/www-non-www-domains-ssl-certificate-redirect\\\/\"},\"wordCount\":1642,\"publisher\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/www-non-www-domains-ssl-certificate-redirect\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/pexels-photo-51213.jpeg\",\"keywords\":[\"Apache\",\"Nginx\",\"SSL Certificates\"],\"articleSection\":[\"Security\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/www-non-www-domains-ssl-certificate-redirect\\\/\",\"url\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/www-non-www-domains-ssl-certificate-redirect\\\/\",\"name\":\"WWW vs Non-WWW: SSL & 301 Redirect Config Guide\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/www-non-www-domains-ssl-certificate-redirect\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/www-non-www-domains-ssl-certificate-redirect\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/pexels-photo-51213.jpeg\",\"datePublished\":\"2026-08-15T03:51:14+00:00\",\"dateModified\":\"2026-08-15T03:51:16+00:00\",\"description\":\"Learn how to configure www and non-www domains with SSL. Implement 301 redirects, secure SANs, manage HSTS, and prevent redirect loops on Apache, Nginx, and CDNs.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/www-non-www-domains-ssl-certificate-redirect\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/www-non-www-domains-ssl-certificate-redirect\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/www-non-www-domains-ssl-certificate-redirect\\\/#primaryimage\",\"url\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/pexels-photo-51213.jpeg\",\"contentUrl\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/pexels-photo-51213.jpeg\",\"width\":1880,\"height\":1248,\"caption\":\"Photo by mali maeder on Pexels\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/www-non-www-domains-ssl-certificate-redirect\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using www and non-www domains with an SSL certificate\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/\",\"name\":\"OWS KB\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#organization\",\"name\":\"Own Web Servers\",\"url\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/OWS-Logo-with-punchline-front-scaled.png\",\"contentUrl\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/OWS-Logo-with-punchline-front-scaled.png\",\"width\":2560,\"height\":994,\"caption\":\"Own Web Servers\"},\"image\":{\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/OWN-WEB-SERVERS-107052961577434\",\"https:\\\/\\\/x.com\\\/OwnWebservers\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/ownwebservers.com\\\/kb\\\/#\\\/schema\\\/person\\\/4a40fe3fe17a08ddd1d7c113668e75f2\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\\\/\\\/ownwebservers.com\\\/kb\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WWW vs Non-WWW: SSL & 301 Redirect Config Guide","description":"Learn how to configure www and non-www domains with SSL. Implement 301 redirects, secure SANs, manage HSTS, and prevent redirect loops on Apache, Nginx, and CDNs.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/","og_locale":"en_US","og_type":"article","og_title":"WWW vs Non-WWW: SSL & 301 Redirect Config Guide","og_description":"Master www vs non-www domain configurations with SSL. Discover best practices for 301 redirects, Let's Encrypt SANs, HSTS, and preventing redirect loops.","og_url":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/","og_site_name":"OWS KB","article_publisher":"https:\/\/www.facebook.com\/OWN-WEB-SERVERS-107052961577434","article_published_time":"2026-08-15T03:51:14+00:00","article_modified_time":"2026-08-15T03:51:16+00:00","og_image":[{"width":1880,"height":1248,"url":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/08\/pexels-photo-51213.jpeg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_description":"Configuring www vs non-www with SSL? Learn how to manage SANs, set up 301 redirects on Apache\/Nginx, enforce HSTS securely, and prevent infinite redirect loops.","twitter_creator":"@OwnWebservers","twitter_site":"@OwnWebservers","twitter_misc":{"Written by":"admin","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/#article","isPartOf":{"@id":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/"},"author":{"name":"admin","@id":"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2"},"headline":"Using www and non-www domains with an SSL certificate","datePublished":"2026-08-15T03:51:14+00:00","dateModified":"2026-08-15T03:51:16+00:00","mainEntityOfPage":{"@id":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/"},"wordCount":1642,"publisher":{"@id":"https:\/\/ownwebservers.com\/kb\/#organization"},"image":{"@id":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/#primaryimage"},"thumbnailUrl":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/08\/pexels-photo-51213.jpeg","keywords":["Apache","Nginx","SSL Certificates"],"articleSection":["Security"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/","url":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/","name":"WWW vs Non-WWW: SSL & 301 Redirect Config Guide","isPartOf":{"@id":"https:\/\/ownwebservers.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/#primaryimage"},"image":{"@id":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/#primaryimage"},"thumbnailUrl":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/08\/pexels-photo-51213.jpeg","datePublished":"2026-08-15T03:51:14+00:00","dateModified":"2026-08-15T03:51:16+00:00","description":"Learn how to configure www and non-www domains with SSL. Implement 301 redirects, secure SANs, manage HSTS, and prevent redirect loops on Apache, Nginx, and CDNs.","breadcrumb":{"@id":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/#primaryimage","url":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/08\/pexels-photo-51213.jpeg","contentUrl":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/08\/pexels-photo-51213.jpeg","width":1880,"height":1248,"caption":"Photo by mali maeder on Pexels"},{"@type":"BreadcrumbList","@id":"https:\/\/ownwebservers.com\/kb\/www-non-www-domains-ssl-certificate-redirect\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ownwebservers.com\/kb\/"},{"@type":"ListItem","position":2,"name":"Using www and non-www domains with an SSL certificate"}]},{"@type":"WebSite","@id":"https:\/\/ownwebservers.com\/kb\/#website","url":"https:\/\/ownwebservers.com\/kb\/","name":"OWS KB","description":"","publisher":{"@id":"https:\/\/ownwebservers.com\/kb\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ownwebservers.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ownwebservers.com\/kb\/#organization","name":"Own Web Servers","url":"https:\/\/ownwebservers.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ownwebservers.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/07\/OWS-Logo-with-punchline-front-scaled.png","contentUrl":"https:\/\/ownwebservers.com\/kb\/wp-content\/uploads\/2026\/07\/OWS-Logo-with-punchline-front-scaled.png","width":2560,"height":994,"caption":"Own Web Servers"},"image":{"@id":"https:\/\/ownwebservers.com\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/OWN-WEB-SERVERS-107052961577434","https:\/\/x.com\/OwnWebservers"]},{"@type":"Person","@id":"https:\/\/ownwebservers.com\/kb\/#\/schema\/person\/4a40fe3fe17a08ddd1d7c113668e75f2","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ba5db5841d48bd7517bb2583e13983e6d2fa56a4099a0b3c61ad2daefc321303?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/ownwebservers.com\/kb"]}]}},"_links":{"self":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/4568","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/comments?post=4568"}],"version-history":[{"count":2,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/4568\/revisions"}],"predecessor-version":[{"id":4571,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/posts\/4568\/revisions\/4571"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media\/4570"}],"wp:attachment":[{"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/media?parent=4568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/categories?post=4568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ownwebservers.com\/kb\/wp-json\/wp\/v2\/tags?post=4568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}