NON-WWW URLS TO WWW WITH HTTPS USING HTACCESS:
You can add the following code to your .htaccess file, you can find it in your website root directory, if you don't find it you can copy this in a text editor and save it as .htaccess, then upload it.
p.s.: Make sure that you backup the .HTACCESS file before you proceed. Incorrect codes can lead to 500 errors.
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
Remove trailing slash
Be careful when turning off the trailing slash. If your host has mod_dir enabled, make sure that you turn off the directory slash, which is enabled by default. This directive will add a trailing slash at the end of a directory regardless of the rules you set up. To disable this, add this to the top of your htaccess file:
DirectorySlash Off
Your browser and even your server, by default, add a trailing slash to a directory. It is done for a reason. If you must strip the trailing slash though, this is how you would do it:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
http://example.com
andhttp://example.com/
are canonically equivalent per RFC 3986, and it's up to your browser which one it chooses to show in the address bar.