Magento Forum

   
Magento force www throws to the homepage
 
rossae
Jr. Member
 
Total Posts:  2
Joined:  2011-08-30
 

Hi,
I have an issue with my URL rewrite configuration that when I go to my website without the www. it redirects to the homepage and not to the page I was going to go to.
e.g:
This works and goes to the product page: http://www.amazonia.com.au/powder.html

Without the www throws to the homepage.: http://amazonia.com.au/powder.html

Ideally I’d like for it just to redirect to the same page with www:

http://amazonia.com.au/powder.html > http://www.amazonia.com.au/powder.html

Thanks in advance.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Ed Baxter
Member
 
Avatar
Total Posts:  53
Joined:  2009-05-27
 

This is the code I use to rewrite all my URLs to a single format; drop it into your .htaccess:

############################################
## 301 the url for SEO
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=permanent,L]

Redirect 301 /home http://www.example.com/
############################################

I hope this fixes your problem.

Cheers.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sendnpay
Jr. Member
 
Total Posts:  7
Joined:  2012-03-09
 

i have exactly the same problem

and to make it worse, this causes customers unable to login as well. would appreciate very much if someone can let me know how to fix this prob.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top