views:

40

answers:

1

I am using .htaccess file to redirect request to files. when i point my site using domain.com all the redirection works properly but when i point my site with www.domain.com it takes me to apache test page.

This is my htaccess file

<IfModule mod_rewrite.c>

 Options +FollowSymLinks

 RewriteEngine on

 RewriteCond %{HTTP_HOST} ^domain\.com/

 RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L]
 RewriteCond %{REQUEST_FILENAME} !-f

 RewriteCond %{REQUEST_FILENAME} !-d 

 RewriteRule ^(.*)$ index.php?url=$1 [PT,L] 

 ErrorDocument 404 index.php

</IfModule>

<IfModule !mod_rewrite.c>

 ErrorDocument 404 index.php

</IfModule>

can any one help me in fixing this, Thanks

A: 

Could it be that your apache config has a virtual host with the ServerName www.domain.com pointing at the default site? What's in your /etc/apache2/sites-enabled (or equivalent)?

Adrian