skip to Main Content

i added in .htaccess

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

but not working with www version

3

Answers


  1. Try this,

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

    it will permanently redirect https://example.com to https://www.example.com

    Login or Signup to reply.
  2. 60/6708# host www.qeo.ca
    Host www.qeo.ca not found: 3(NXDOMAIN)
    

    I don’t think you have an issue with the .htaccess file but rather with your DNS configuration. So update your DNS records so the domain will point to your cPanel server’s ip address.

    If your computer is not able to resolve the host http://www.qeo.ca or qeo.ca then it’s pretty obvious that you won’t be able to access it in your browser. Your qeo.ca has these nameservers:

    Name servers:
        dns1.registrar-servers.com
        dns2.registrar-servers.com
    

    So go to your registrar, edit your DNS zone and update the records. Keep in mind that after DNS update it could take a few hours until you’ll be able to actually access your website.

    Login or Signup to reply.
  3. Try this

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    

    The above code worked for me, hope it helps.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search