View Full Version : Redirect question from SEO point of view
abbottsys
10-23-2007, 11:47 AM
I have a big project coming up and I need to get a better understanding of redirects from an SEO point of view.
I realize that a 301 (permanent redirect) is issued at the server level. Are there any redirects that can go in at the DNS level? How do these things effect SEO? Is there is a "correct" way to do this to keep the spiders happy?
I would appreciate any help from an SEO guru who's been through this.
Not sure what you mean by DNS level but, "301" is all you need to know.
"If you are permanently redirecting from one page to another, use a permanent redirect (301)."
http://www.google.com/support/webmasters/bin/answer.py?answer=48551&query=301&topic=&type=
Need more?
abbottsys
10-23-2007, 01:55 PM
Thanks beu. I was hoping it was that simple, but just wanted to check.
Thanks beu. I was hoping it was that simple, but just wanted to check.
No problem, sounds deceptively easy I know!
abbottsys
10-23-2007, 03:23 PM
No problem, sounds deceptively easy I know!
Apparently there are a few different ways to issue a 301. Just to get specific, is below the correct way to do it on an Apache Server. I would be using the "To Change domain names:" option.
Using .htaccess for Redirection
When using Apache web server directory-specific .htaccess file can be used.
To Move a single page:
Redirect 301 /oldpage.html http://www.example.com/newpage.html
To Change domain names:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^.*oldwebsite\.com$ [NC]
RewriteRule ^(.*)$ http://www.preferredwebsite.net/$1 [R=301,L]
Marcia
10-24-2007, 06:51 AM
I had to help someone out with canonical and duplicate content/multiple domain name issues, and this is what I had to do. First I had to redirect non-www to www on the site. Done like this, using mod_rewrite:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
Then, I had to redirect a mis-spelling (two domains, actually) to the correct domain, and I wanted it to resolve to the correct domain whether it was typed in with or without the www.
To keep it simple, this is what worked:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^otherdomain\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.otherdomain\.com
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
So that's what you'd do for:
1) Fixing canonical issues on the same domain, using mod_rewrite.
2) Redirecting one domain name (two in my case) to another using mod_rewrite, so they only resolve for the chosen domain name (as in your case)
Marcia
10-24-2007, 07:49 AM
Apparently there are a few different ways to issue a 301. Just to get specific, is below the correct way to do it on an Apache Server. I would be using the "To Change domain names:" option.Right. And two different Apache Modules that can be used for redirection.
To Move a single page:
Redirect 301 /oldpage.html http://www.example.com/newpage.htmlThat's mod_alias (much easier):
Apache Module: mod_alias (http://httpd.apache.org/docs/2.0/mod/mod_alias.html) and Module mod_alias (http://httpd.apache.org/docs/1.3/mod/mod_alias.html)
To Change domain names:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^.*oldwebsite\.com$ [NC]
RewriteRule ^(.*)$ http://www.preferredwebsite.net/$1 [R=301,L]That's mod_rewrite (harder, always test carefully):
Apache mod_rewrite Introduction (http://httpd.apache.org/docs/2.2/rewrite/rewrite_intro.html)
abbottsys
10-25-2007, 11:21 AM
Marcia - Many thanks for the detailed answer. Very helpful. So, bottom line is that if I want to 301 domains in an "SEO safe" way then I should use Apache mod_rewrite. Correct?
Marcia
10-25-2007, 11:43 AM
I'd say mod_alias (because it's simpler) for simple 301 redirection tasks (like a moved file or changed filename), but with two or more domain names in the same hosting space, mod_rewrite is the way to go.
There are other modules available in Apache that do neat stuff, but mod_rewrite is referred to as the webmasters' "Swiss Army Knife" for good reason.
detailed answerThere are no doubt more "economical" ways to do the code, like I believe you only have to turn mod_rewrite on one time. But I just ordered the book from Amazon yesterday (for real), and it won't get here until next week - so for now I stay with the simplest possible way to do things. ;)