Note: There are same questions already available in stackoverflow. I tried those but still not working.
What is my requirement is that if someone try to access our site with url
http://oursite.com
then it should redirect to
http://www.oursite.com
for the SEO purpose.
I am facing a problem with Redirect 301 in Magento. I tried to use
admin->System->Configuration->Web->Url Options->Auto-redirect to Base URL
and I have set it to Yes (301 Moved Permanenty) but still it is not working. I tried to edit .htaccess also with following code block
Redirect 301 http://oursite.com http://www.outsite.com
But still it is not working. I have no any idea about what could be the reason. Any suggestion please.
Assuming that in admin -> System -> Configuration -> Web -> Unsecure
Then your redirect to base url should work
If you want to use .htaccess then try