non www to www

#95628
  • Resolved Danny
    Rank Math free

    Hi,

    I changed my url in wordpress to include the www. in front of the domain. All is working fine in my website and when I write the domain without www it automatically includes it in front of the url.

    However, I read that I needed also to do a 301 rederect of all my pages from https://domain.com to https://www.domain.com .

    My website is very new, but searching google all pages show without the www, so I guess I have to do this rederect.

    Since I do not want to add an extra plugin and I have rank math, I went to read the support documents, but I couldnt figure out the best way to do the non www to www rederect.

    in the documents it says to add the source being the /page_name, but this is not my case as for example, the home page is just domain.com and has no / .

    last, I wanted to say, every url that contains my domain.com without www, direct to www. Like this I wont have to do 10 or more rederects of every page I have.

    Any suggestion?

    Many thanks

Viewing 1 replies (of 1 total)
  • Alberto
    Rank Math business

    Hello,

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    Usually the best option there is to use the .htaccess file to create those redirections. You should add the following code (replace the URL with yours):

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

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘non www to www’ is closed to new replies.