The only way to redirect safely with regards to search engine optimization is to use an 301 Redirect.
Why? 301 keeps the value and weight of the referring page. Robots, like Google, love it. If you are going to delete a page, consider redirecting it using a 301 redirect.
As I’m a “linux web dood”, here is the PHP and .htaccess equivalent:
<?php
header( “HTTP/1.1 301 Moved Permanently” );
header( “Location: http://www.new-url.com” );
exit;
?>
The above code must be placed before any output is sent to the browser to avoid any header errors.
Redirect a single web page to a new location.
redirect 301 /index.html http://www.domain.com/index.html
redirect permanent /index.html http://www.domain.com/index.html
redirectpermanent /index.html http://www.domain.com/index.html
Redirect old domain to new domain
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
There you have it. Simple, but effective. Keep your page strengths. Treat each page as individuals!!
3 Responses for "The Only Safe SEO Redirect"
Use if(!headers_sent()) block around the headers, should fix some problems for users. Could even use an else block with trigger_error() to inform the user what has happened.
Thanks,
Dan
301’s are good. great tip and nice words. im trying to push for deisgn creatives to work with seo types more
Cheers for your comments Daniel and James!
Leave a reply
You must be logged in to post a comment.