How to redirect user from none www http to www https ?

Scenario:

You want to force all users/client to access your website using https instead of http.

Requirement:
  1. If you do not have a valid SSL Certificate, you will need to buy it. You can check the price here  if you would like to buy it from us. Once you have your own SSL Certificates you will need to installed it at your cPanel account. If you already have one, you can install it directly to your cPanel account.
  2. Make sure your SSL Certificate that you are going to install onto your cPanel has your domain as the CN info. else, you will get SSL Certificate error notification.
Solutions:

You will need to add below script into your .htaccess

    1. Login to your cPanel and click on the File Manager > make sure you tick on "Show hidden files".
    2. Go to your public_html folder and find .htaccess file.
    3. Select .htaccess file and right click on it. Please select Edit option or Code edit option.
    4. Now it will open a new tab with contents inside your .htaccess file.
    5. Copy below script and paste it inside your .htaccess
      <IfModule mod_rewrite.c>
      RewriteCond %{HTTP_HOST} !^www\.
      RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI}$1 [R=301,L]
      RewriteCond %{HTTPS} off
      RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}$1
      </IfModule>
    6. Click save button and test it.
Notes:
    You can custom the script above to fit with your requirement.

Was this answer helpful?

Also Read

Why is SEO important?

SEO (Search Engine Optimization) enables your website to be more accessible by the search...

How to redirect user from none www to www.domain?

Scenario: You want to force all users/client to access your website using https instead of http....

How do I configure a cron job?

Login to cPanel. Locate and click on the "Cron Jobs" icon under the "Advanced" category. Fill...

How to manage git version control ?

  How to Create a Git Repository with cPanel   Step 1 : Login to cPanel account Step 2 :...

My website is running slow

If you are using a forum or content management system, make sure that caching is enabled. Caching...