I am looking to redirect my site abc[dot]com to www[dot]abc[dot]com forcefully using .htaccess file. I am using following permissions in my file RewriteCond %{HTTP_HOST} ^example.com$ RewriteRule (.*) http://www.example.com/$1 [R=301,L] In my httpd.conf I have made the following change IndexIgnore .htaccess <FilesMatch "^.ht"> Order allow,deny AllowOverride all //added this line Deny from all </FilesMatch> and rebooted it. Still the same. VPS runs cent os 6 64 bit. The site was earlier hosted on shared hosting, where .htaccess worked perfectly.
I believe you will want to put your AllowOverride in the <Directory> portion of your virtualhost configuration. For example: <Directory /var/www/> AllowOverride All allow from all </Directory> Code (markup): Change the directory above to match where your web files are.
This would most likely not be in httpd.conf. You'd want this in where your actual <VirtualHost> definition is for your domain.