Turns out mod_rewrite
rules are fine in the VirtualHosts file, apart from the RewriteBase
rule. I ended up with this:
<VirtualHost *>
ServerName www.example.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.example.com
RewriteRule ^/(.*)$ http://example.com/$1 [L,R=301]
</VirtualHost>
EDIT: on the advice of joschi in the comments, I'm now using this simplified version using the Redirect
directive from mod_alias
:
<VirtualHost *>
ServerName www.example.com
Redirect 301 / http://example.com/
</VirtualHost>
i assume that your hostname is proper (li141-187.members.linode.com)
in /etc/apache2/httpd.conf change the line below,
NameVirtualHost *
to NameVirtualHost 109.74.194.187:80
& there can be a duplicate NameVirtualHost in your /etc/apache2/sites-enabled/webmin.1273066327.conf file in line 1. check if exists. if yes delete that line.
& edit the VirtualHost definition in /etc/apache2/sites-enabled/000-default file as follows.
<VirtualHost 109.74.194.187:80>
ServerName 109.74.194.187
.......
& edit the lines in /etc/apache2/sites-enabled/www.accontax.be as follows.
<VirtualHost 109.74.194.187:80>
ServerName accontax.be
ServerAlias www.accontax.be
.......
then apache2ctl restart
.
& and also check you bind's zone file for accontax.be, it should be like configuration below.
$ttl 38400
@ IN SOA accontax.be li141-187.members.linode.com. (
SOA_SERIAL_NUMBER
10800
3600
604800
38400 )
accontax.be. IN NS ns1.linode.com.
accontax.be. IN NS ns2.linode.com.
accontax.be. IN A 109.74.194.187
www.accontax.be. IN A 109.74.194.187
ftp.accontax.be. IN A 109.74.194.187
webmail.accontax.be. IN A 109.74.194.187
mail.accontax.be. IN A 109.74.194.187
accontax.be. IN MX 5 mail.accontax.be.
accontax.be. IN TXT "v=spf1 a mx a:accontax.be ip4:109.74.194.187 ?all"
there should be your own serial number for domain, intodns.com says so.
change SOA_SERIAL_NUMBER with your own above.
& this link will give you more information about DNS configuration.
http://www.intodns.com/accontax.be
it seems your are using webmin.
it's much better to do all these changes in webmin for you.
Check everything under "Servers" menu, in apache menu, check your module config is ok before changing anything. & also change startup command for apache in webmin to apache2ctl. do not allow webmin to use /etc/init.d/apache2 script.
Best Answer
Have you refreshed your browsers cache?