Redirect to Higher Search Rankings
Let’s talk about URL redirection and how a close attention to detail can make a huge difference with Search Engine Optimization (SEO).
There are almost as many techniques for URL redirection as there are reasons to utilize it. Some of the most common include the Refresh meta tag, java-script redirect, server-side scripting, and mod_rewrite. I am going to focus on a mod_rewrite redirect inside an .htaccess file and show you how to pass a 301 Server Status code (remember those from the last issue?) to maximize for SEO.
I will use an example for the Apache HTTP server, but you should be able to use the same syntax in IIS if you use an ISAPI Rewrite filter.
First, create a file named .htaccess in the web root and turn the rewrite engine on: <CODE>REWRITEENGINE ON</CODE>
Then, create a condition to trigger the rewrite: <CODE>REWRITECOND %{HTTP_ HOST} ^LEAPFROGINTERACTIVE.COM [NC]</CODE>
Let me simplify that for you. Basically, if the web client requests a URL that begins with, for example, leapfroginteractive. com (no matter the type case), then match and move to the rule.
Finally, create a rule: <CODE>REWRITERULE ^(.*)$ HTTP:// WWW.LEAPFROGINTERACTIVE. COM/$1 [L,R=301]</CODE>
This simply states to redirect to www.leapfroginteractive.com and stop at this rule. This line is where the attention to detail comes into play. R=301 sends the 301 server status code which means, “Moved Permanently.” Without the 301 redirect, search engines could index two separate versions of the website: one for leapfroginteractive.com and the other for www.leapfroginteractive.com. By using the 301 redirect, you can focus your SEO efforts on a single site and make sure it is as visible to the search engines—and potential clients—as possible.