www. Redirect Isssue

#102607
  • Resolved Balvinder Bolla
    Rank Math free

    Hello,

    For some reason when you type in my site name without www it takes the users to https://sitename It should be redirecting users to https://www.sitename but is not.

    is there an easy fix?

    The WordPress settings are correctly set so I am a little confused why this is happening.

    Please advise

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

    Thank you for getting in touch with us.

    To redirect your website from non-www to www, add the following lines in your website’s .htaccess file:

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

    Replace yourdomain.com with your actual domain name.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Thank you.

    I have inserted this code and it works.

    The issue I have found is that every time there is a plugin update this reverts to its original code without the redirect code.

    Any advice on how to stop this from happening?

    Mehdi
    Rank Math free

    Hi, I have the same problem, so no need to open a new ticket since this is still open for new replies.

    My site has a WWW Canonicalization as it shows in my Rank Math Analysis, and I can’t add those code in my .htaccess file because I don’t have access to it as my host support told me, and they suggest to use a simple redirection plugin to do it.

    My question is: since Rank Math has a feature to use redirection, how can I use it to redirect all WWW to non-www and all http to https??

    hi,

    thanks for that advise. I have used this is the past. the issue re-occurs. Basically, when there is an update the code disappears.

    Is there another solution?

    Hello,

    Did you add the code via Rank math or FTP? You can use the FTP method and let us know if it is still removed after every update

    @Mehdi
    I have replied to your ticket:https://support.rankmath.com/ticket/i-cant-edit-htaccess-to-redirect-www-to-non-www/?view=all, please check.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hi. I updated it through a plugin called WP file manager.

    I will try the ftp method

    Hello,

    You can also edit your htacess in Rank math > General Settings > Htaccess, here is a screenshot for reference: https://i.rankmath.com/gxqhKb . Let us know if this works for you.

    Hope this helps.

    Thank you

    Hello,

    Glad that helped.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

The ticket ‘www. Redirect Isssue’ is closed to new replies.