Have 2 versions of my website, a www. and non-www. and I’m worried about SEO

#1006661
  • Resolved Ben Cross
    Rank Math free

    I have 2 versions of my website a www. version and non www. version. I’m worried its hurting my SEO, I’ve used rankmath plugin to set canonical URL for posts but both version are still there if I type it in to my URL.

    I also followed this guide but it didn’t work: https://rankmath.com/kb/how-to-redirect-www-urls-to-non-www/.

    My domain is set up with Namecheap, host is hostinger and I’m using litespeed cache with QUIC.cloud CDN. Can you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    We apologize for the issue you are facing with the two versions of your website. Having both www and non-www versions can indeed affect your SEO if they are not properly redirected to one preferred version.

    Since you’ve already set canonical URLs for your posts, the next step is to ensure that proper 301 redirects are in place from one version to the other. Here’s a brief overview of what you can do:

    1. Check WordPress Settings: Ensure that both the WordPress Address and Site Address in your WordPress settings are set to the preferred version (either www or non-www). You can find this under Settings → General in your WordPress admin area.
      Website Address and Site Address - WordPress General Settings

    2. Edit .htaccess File: Since you are using LiteSpeed, you can add redirection rules to your .htaccess file. Here’s a code snippet to redirect from www to non-www:

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

      Make sure to replace example.com with your actual domain name. You can edit the .htaccess file directly from the Rank Math plugin by navigating to Rank Math SEO → General Settings → Edit .htaccess.
      Add .htaccess redirection for URL version (www or non-www)

    3. Use htaccess Tester: Before applying changes, you can use an htaccess tester to ensure that your rewrite rules are correct.

    4. Check CDN Settings: Since you are using QUIC.cloud CDN, ensure that there are no conflicting settings there that might be causing issues with redirection.

    If you have followed these steps and the issue persists, please reply to this ticket with any specific error messages or behaviors you are experiencing, and a human agent from our support team will assist you further.

    Thank you for raising this concern!

    Sources:
    Why Are Posts Redirecting to www or Non-www Incorrectly?

    Ben Cross
    Rank Math free

    I’ve tried the recommednations, but that only redirects the homepage, not all my other pages

    Ben Cross
    Rank Math free

    I put it at the start of my .htaccess file and now it works.

    Hello,

    We are glad to know that this issue has been resolved. Thank you for letting us know.

    This ticket will be closed now, but you can always open a new one if you have any other questions or concerns. We are here to help you with anything related to Rank Math.

    We appreciate your patience and cooperation throughout this process.

    Thank you for choosing Rank Math.

Viewing 4 replies - 1 through 4 (of 4 total)

The ticket ‘Have 2 versions of my website, a www. and non-www. and I’m worried about SEO’ is closed to new replies.