I have my HAProxy working to route my domain.com to the correct server, but I want to rewrite the header so it will point to the www version of the domain and its not working. Does the RewriteRule work in a ssl VirtualHost:
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/kohanyim/html
ServerName kohanyim.com:443
#ServerAlias *.kohanyim.com:443
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error-kohanyim-ssl.log
CustomLog ${APACHE_LOG_DIR}/access-kohanyim-ssl.log combined
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^/(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</VirtualHost>
</IfModule>
or what is the best (solution or rule) to use or should both use the same DocumentRoot (if you can)?