In some case .htaccess files may not work. Therefore, we need to do a slight modification in httpd.conf file to get everything on work correctly. To allow .htaccess to override httpd.conf add following lines to httpd.conf.
AllowOverride All
Order allow,deny
Allow from all