The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Intermediate & Advanced SEO
    4. After adding a ssl certificate to my site I encountered problems with duplicate pages and page titles

    After adding a ssl certificate to my site I encountered problems with duplicate pages and page titles

    Intermediate & Advanced SEO
    4 3 168
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LovingatYourBest
      LovingatYourBest last edited by

      Hey everyone!

      After adding a ssl certificate to my site it seems that every page on my site has duplicated it's self. I think that is because it has combined the www.domainname.com and domainname.com. I would really hate to add a rel canonical to every page to solve this issue. I am sure there is another way but I am not sure how to do it. Has anyone else ran into this problem and if so how did you solve it?

      Thanks and any and all ideas are very appreciated.

      1 Reply Last reply Reply Quote 0
      • donford
        donford last edited by

        HI Travis

        Yes, you can use your .htaccess file to fix this. (This file should be located in your home directory)

        A simple example would be

        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^YourDomain.com
        RewriteRule ^(.*)$ http://www.YourDomain.com/$1 [R=301,L]

        What this does is looks for any request for non-www urls, if found it 301 redirects it to the www version of the page.

        Hope this helps,

        Don

        LovingatYourBest 1 Reply Last reply Reply Quote 2
        • BlueprintMarketing
          BlueprintMarketing last edited by

          **`Don is right
          If on Nginx use`**
          
          <code>server {
          server_name [example.com](http://example.com/);
          rewrite ^/(.*) [https://example.com/$1](https://example.com/$1) permanent;
          }</code>
          
          <code>server { listen 80; server_name my.domain.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl; server_name my.domain.com; [....] }</code>
          
          <code>server { listen 80; server_name yourdomain.com www.yourdomain.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl spdy; server_name yourdomain.com www.yourdomain.com; ssl on; ssl_certificate /var/www.yourdomain.com/cert/ssl-bundle.crt; ssl_certificate_key /var/www/yourdomain.com/cert/yourdomain.com.key; access_log /var/log/nginx/yourdomain.com.access.log rt_cache; error_log /var/log/nginx/yourdomain.com.error.log; root /var/www/yourdomain.com./htdocs; index index.php index.htm index.html; include common/wpfc.conf; include common/wpcommon.conf; include common/locations.conf; }</code> 
          
          `https://christiaanconover.com/blog/how-to-redirect-http-to-https-in-nginx`
          

          https://moz.com/learn/seo/redirection

          https://wp-mix.com/htaccess-redirect-http-to-https/

          https://www.digitalocean.com/community/questions/http-https-redirect-positive-ssl-on-nginx

          1 Reply Last reply Reply Quote 0
          • LovingatYourBest
            LovingatYourBest @donford last edited by

            Hi Donford,

            Excuse the delay. We have been very busy but we are working on updating our .htaccess file. Thank you for the quick response. We will let you know if it resolves our issues.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Duplicate page wordpress title
              evolvingSEO
              evolvingSEO
              1
              7
              175

            • Base copy on 1 page, then adding a bit more for another page - potential duplicate content. What to do?
              Linda-Vassily
              Linda-Vassily
              0
              5
              124

            • Confused About Problems Regarding Adding an SSL
              KempRugeLawGroup
              KempRugeLawGroup
              0
              11
              181

            • Duplicate content within sections of a page but not full page duplicate content
              J_Sinclair
              J_Sinclair
              0
              3
              112

            • Duplicate titles and descriptions problem?
              EcommerceSite
              EcommerceSite
              0
              7
              103

            • Duplicate page content and Duplicate page title errors
              Cyrus-Shepard
              Cyrus-Shepard
              0
              9
              834

            • Duplicate page content and duplicate pate title
              RyanKent
              RyanKent
              0
              3
              555

            • How do I fix the error duplicate page content and duplicate page title?
              rtavs
              rtavs
              0
              4
              467

            Get started with Moz Pro!

            Unlock the power of advanced SEO tools and data-driven insights.

            Start my free trial
            Products
            • Moz Pro
            • Moz Local
            • Moz API
            • Moz Data
            • STAT
            • Product Updates
            Moz Solutions
            • SMB Solutions
            • Agency Solutions
            • Enterprise Solutions
            • Digital Marketers
            Free SEO Tools
            • Domain Authority Checker
            • Link Explorer
            • Keyword Explorer
            • Competitive Research
            • Brand Authority Checker
            • Local Citation Checker
            • MozBar Extension
            • MozCast
            Resources
            • Blog
            • SEO Learning Center
            • Help Hub
            • Beginner's Guide to SEO
            • How-to Guides
            • Moz Academy
            • API Docs
            About Moz
            • About
            • Team
            • Careers
            • Contact
            Why Moz
            • Case Studies
            • Testimonials
            Get Involved
            • Become an Affiliate
            • MozCon
            • Webinars
            • Practical Marketer Series
            • MozPod
            Connect with us

            Contact the Help team

            Join our newsletter
            Moz logo
            © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
            • Accessibility
            • Terms of Use
            • Privacy