Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Use a redirect on your main site to do a perm redirect all example.com traffic to https://www.example.com instead.

    Basically, add this to the .htaccess file in your web root:

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

    That will redirect everything without the “www” to the same thing but with the www. Search engines will pick up on it and redirect as well.

    I prefer to use these rules. They’re similar in nature, however they always redirect the www version to the NON-www version of my domain.

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

    This is the more preferred way to do it nowadays, as www is deprecated.

    Thread Starter scuba5794

    (@scuba5794)

    thanks does it matter where in the .htaccess file i put it?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    Should be the first lines in the file, before anything else.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘need help with www.example and example.com’ is closed to new replies.