the thread ends with Jim's reply which I found very useful and did the job but did not address the problem i mentioned above... for those who do not want to visit the thread, jim's reply is here
After some off-line consulting, the simplified and more-efficient solution turned out to be like this, with all code in the root .htaccess file:
# Externally redirect all HTTP or HTTPS direct client requests
# for index.htm or index.html pages to HTTP home page "/"
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index\.html?(\?[^\ ]*)?\ HTTP/
RewriteRule ^index\.html?$ http://www.example.com/ [R=301,L]
#
# Externally redirect all HTTPS requests for non-secure resources to HTTP
# except for js, css, and image files shared between SSL and non-SSL
RewriteCond %{SERVER_PORT} =443
RewriteCond $1 !^secure-directory/
RewriteCond $1 !\.(js¦css¦gif¦jpe?g)$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
#
# Externally redirect all HTTP requests for secure resources (files in
# the /secure-directory subdirectory) to HTTPS, except for the index
# page at /secure-directory/
RewriteCond %{SERVER_PORT} !=443
RewriteRule ^(secure-directory/.+)$ [
example.com...] [R=301,L]
#
# Externally redirect all requests for non-blank, non-canonical hostnames to
# the canonical domain, preserving the original request's HTTP/HTTPS protocol
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteCond %{SERVER_PORT}>s ^(443>(s)¦[0-9]+>s)$
RewriteRule ^(.*)$ http%2://www.example.com/$1 [R=301,L]
Replace all broken pipe "¦" characters with solid pipes before use; Posting on this forum modifies the pipe characters.
Jim