Welcome to WebmasterWorld Guest from 34.236.216.93

Forum Moderators: open

Message Too Old, No Replies

Redirect non-www to www: 301 vs 302 with pages

     
6:02 pm on Jan 6, 2016 (gmt 0)

Full Member

5+ Year Member Top Contributors Of The Month

joined:May 11, 2012
posts:320
votes: 3


Simple question. So, my site is officially listed with www, and I want to redirect non-www traffic to the www domain.

On the homepage, the results are clear. http://example.com goes to http://www.example.com as a 301 redirect. The issue now is, when I try a page like http://example.com.tld/about-us, it doesn't go to http://www.example.com.tld/about-us but instead http://www.example.com.tld. This would be find except it's still a 301 redirect. Doesn't this tell Google to ignore any traffic including back link juice going to http://example.com.tld/about-us and give it to http://www.example.com instead? What about sites that have the about us page listed without www?

Should I make all redirects 302 instead of 301? Or just redirect every non-www page back to the homepage as a 301?

By the way, I use Magento. Sort of confused about when to use 302 and when not too. I know 301 is permanent, which is what makes me nervous about permanently sending traffic from a page to the homepage.

[edited by: engine at 6:16 pm (utc) on Jan 6, 2016]
[edit reason] please use example.com [/edit]

6:21 pm on Jan 6, 2016 (gmt 0)

Administrator from US 

WebmasterWorld Administrator not2easy is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Dec 27, 2006
posts:4510
votes: 348


In the Apache Forum, there is a Library with the kind of help you need. Your 301 redirect is not capturing the part after the domain name and sending it with the page request. See the correct way to 301 with the page included here: [webmasterworld.com...]

You never want to 302 a www redirect.
9:48 pm on Jan 6, 2016 (gmt 0)

Full Member

5+ Year Member Top Contributors Of The Month

joined:May 11, 2012
posts:320
votes: 3


Thank you for the replying back. I was able to find what I needed through that link.