Well, you don’t really have anything in your frontend currently that would actually redirect requests from https://domain.com to https://www.domain.com. Your current acl www_match_acl only checks if www.domain.com is already being used.
In order to have the redirect working I would replace your frontend config (starting with the acl) with this:
acl no_www_acl ssl_fc_sni -i domain.com
http-request redirect location https://www.domain.com%[capture.req.uri] code 302 if no_www_acl
use_backend apptest_server if !no_www_acl
So, if https://domain.com was requested, then redirect to https://www.domain.com (keeping any additional path or query string elements, if present). Send to apptest_server otherwise.
This config only works with browsers supporting SNI, but pretty much everything these days does. Alternatively you could write the acl like this (note the exact match):
acl no_www_acl hdr(host) -i domain.com