Combine .htaccess. ( http to https AND www to non www AND remove trailing slash ) extending normal craftcms .htaccess I can't manage to combine all above options. Tested with several options and examples only the most examples focusses only on on problem.

The example of .htaccess below is okay but i cannot manage to add the trailing slash combining with www and the http.

Testing with: https://htaccess.madewithlove.be/

SEO company want's to get rid of trailing slash. I see that most of CraftCMS installs responds to slash AND non slash. 

See : craftcms website pricing and pricing/ 

are also both okay....thats also not ideal while you can introduce duplicate pages for google.

Recap:

http://www.domainname.nl  -> https://domainname.nl
http://www.domainname.nl/products/ -> https://domainname.nl/products (without trailing slash)

https://domainname.nl/products/      https://domainname.nl/products (without trailing slash)


    RewriteEngine On

# Redirect www to non www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

# Redirect http to https
RewriteCond %{HTTPS} !on

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p=$1 [QSA,L]
Update 12/06/2018:

Tested now succesfully following version on my server

# Redirect www to non www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

# Redirect http to https
RewriteCond %{HTTPS} !on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

# redirect /bla/ to /bla
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]