Direct non www to www

daniel
edited November -1 in Support Forums

How do i direct non www to www i have tried severally using .htaccess inside htdocs but its not working. I need the full codes for htaccess please

Comments

  • iLikeHD
    edited November -1

    .htaccess code:

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

  • daniel
    edited November -1

    i tried all that and its not working at all can admin tell us the issue why .htaccess its not working

  • Admin
    edited November -1

    i tried all that and its not working at all can admin tell us the issue why .htaccess its not working

    Post your complete .htaccess that you are currently using. It's not a support related issue, it's on your end.

  • TheCrafters
    edited November -1

    i tried all that and its not working at all can admin tell us the issue why .htaccess its not working

    Post your complete .htaccess that you are currently using. It's not a support related issue, it's on your end.

    Can you not also use Softaculus to do that for you?

  • daniel
    edited November -1

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

  • daniel
    edited November -1

    sorry guys i realized where the problem was. i named my htaccess file without dot before it.

  • Admin
    edited November -1

    sorry guys i realized where the problem was. i named my htaccess file without dot before it.

    Good to know that you have finally resolved the issue you were experiencing.