I had an issue with website redirection and I found that my rewritecond input= 'www.example.com' and my request header host = 'example.com'. So I try to apply UseCanonimalName On in vhost where my ServerName define as 'www.example.com' by hoping that when both are matched, my website redirection will happen but unfortunately it doesn't and host in my request header still remain 'example.com'. I refer to this and this to do it.
Below are my httpd-vhost.conf:
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
UseCanonicalName On
DocumentRoot "d:/wamp64/www/example"
<Directory "d:/wamp64/www/example/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Order allow,deny
Allow from all
Header always set Strict-Transport-Security "max-age=63072000; includeSubDomains"
</Directory>
</VirtualHost>
Below are the expectation that I would want to receive:
The host is changing from example.com to www.example.com but unfortunately, it only works in Firefox but not other browsers which IDK why?!
***Am using Windows server
Please correct me if I understand or do it wrongly. Thanks all!