Forum Moderators: Robert Charlton & goodroi
Look into the 301 threads pretty closely before you decide what you want to do.
Cygnus
Particularly, study the urls that Google sends traffic to. If they almost all have "www" or almost all have "no-www" then that gives you a cueas to which way your redirect would best go. But if it's a real mix of both types of urls, then any redirect would probably result in a bump in the road for at least a little while.
Again, I emphasize caution if your current Google traffic is strong.
If you recently saw a drop in Google for major keywords then you are in the same boat as many PR7 sites that have been around and hit hard recently. Your situation is NOT unique.
Do understand that both 301 sites and sites without redirect still can rank on top of google on top keywords. Bad example Wired magazine not only doesn't use 301 but uses multiple domains with the same content. Don't do that ;-)
In this case, however, there's a variation in the the little green bar.
The one real value of the little green bar is in telling you that you have a problem.
You have a problem; things will deteriorate. Sure, you can wait until you fall out of the serps, and then put in a 301 - but why wait?
A 301 from non-www to www, set up correctly and checked, can only help your site. You choice ;)
I was wondering what's better...setting up pure 301 redirection (via .htaccess, setting up one 301 redirect line), or setting up mod_rewrite redirection (w/o responsing with 301 header, but with pure 200 OK one)?
Do you know what's better, or do both of them are just the same thing?
I was wondering what's better...setting up pure 301 redirection (via .htaccess, setting up one 301 redirect line), or setting up mod_rewrite redirection (w/o responsing with 301 header, but with pure 200 OK one)?
You have to return an HTTP status code 301. You can do it with either .htaccess or mod_rewrite. If you're not using .htaccess for something else already, mod_rewrite is usually more efficient as far as the server is concerned. If you're already using .htaccess I don't think it makes much difference in efficiency to put the redirect there.
[edited by: engine at 2:09 pm (utc) on July 24, 2006]
[edit reason]
[1][edit reason] examplified [/edit] [/edit][/1]
>>>>No, this question gets asked several times per week for the last 18 months or more.
>>>>It's about as unique as sand on a beach.
Lol, yep - would be more unique if you did not have this problem.
Google have had such problems with this area it really is unbelievable.
Then that is NOT redirection.
THAT is serving duplicate content; the same content at two different URLs.
Get the 301 REDIRECT in place to fix that.
They you have one URL that serves content with a 200 status, and one URL that says "the content is over THERE".
You can do it with either .htaccess or mod_rewrite.
D-oh! Of course you can do mod_rewrite inside .htaccess. I was mixing up two ways you can vary it: (a) use mod_rewrite or a simple "redirect" directive, (b) put it in .htaccess or in the server configuration file.
I run my own server, so I always put my redirects in the server config file for efficiency's sake, but most people don't have that option. I don't think there's much difference between mod_rewrite and the "redirect" directive.
RewriteBase /
RewriteCond %{HTTP_HOST} ^site\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
is the right thing? (using mod_rewrite) (R=301, should be 301 redirect, am I right?)
[edited by: engine at 2:09 pm (utc) on July 24, 2006]
[edit reason]
[1][edit reason] examplified [/edit] [/edit][/1]
The first one redirects only site.com to www.site.com
The second one redirects anything that is not www.site.com to www.site.com - that is it will also redirect foo.site.com and bar.site.com to www.site.com.
There must be a space before the exclamation mark to make it work. The forum software removes that space here.
.
My version of this is:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]