Good morning everybody,
I am using Virtualmin to manage our portals and I have a problem on the usage of RewriteCond in the apache configuration of a custom template.
Starting from the default directives of apache (below):
ServerName ${DOM}
ServerAlias www.${DOM}
DocumentRoot ${HOME}/public_html
ErrorLog /var/log/virtualmin/${DOM}_error_log
CustomLog /var/log/virtualmin/${DOM}_access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory ${HOME}/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
<Directory ${HOME}/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
The following configuration has been added in order to rewrite the domain.com to www.domain.com
RewriteEngine on
RewriteCond %{HTTP_HOST} =${DOM} [NC]
RewriteRule ^(.*) http://www.${DOM}$1 [R=301,NE]
But this configuration it seems not working on the domain.
Do you have any suggestion?
Thanks for help!
Simone