As many of you know I recently updated my entire website and in the process I had to setup 301 redirects for the new page names. Why should you do this when updating a site? It’s simple, when someone does a search on Google, Bing or Yahoo! it would yield a blank or 404 error page if there is no 301 redirect implemented. A 301 redirect basically takes the old URL/page name and redirects it to the new page or URL. Thus the information a prospective client is searching for will still come up seamlessly This can mean the difference between a new client and a passerby. But wait, couldn’t I have created the new pages with the old file names, Yes, I could have but I believe the newer page names I made are contextually more appropriate to the current content and making them more SEO friendly. Also, I didn’t want to lose all of that old “Google juice” I had built up over the last 5 years, hence, I needed a 301 redirect. There are many ways to setup 301 redirects but the following way is the easiest and most search engine friendly approach. However, it should be noted that this HTAccess approach is for Apache servers only.
Open a simple text file and name it .htaccess (you can not use Word or WordPad it must be a simple text editor with no formatting).
Depending on what you’re trying to do, redirect an entire site to a new domain or just redirect a page it would be as shown below.
Redirecting a single page
Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
Redirect 301 /oldpage2.html http://www.yoursite.com/folder/
Redirect an entire site
This way does it with links intact. That is, www.oldsite.com/some/link.html will become www.newsite.com/some/link.html. This is extremely helpful when you are just “moving” a site to a new domain.
Place this on the OLD sites HTAccess file:
Redirect 301 / http://newsite.com/
Here is an example of my .htaccess file:
RewriteEngine on
ErrorDocument 404 /404.html
%{HTTP_HOST} ^www.reelwebdesign.com$
^/?$ "http\:\/\/reelWebDesign\.com" [R=301,L]
Redirect /web_SMM_packages_NYC.html http://reelwebdesign.com/social-media-marketing-plans.php
Redirect /web_SEO_packages_NYC.html http://reelwebdesign.com/SEO-packages-NYC.php
Redirect /web_design_ny.html http://reelwebdesign.com/contact.html
Redirect /online_public_relations.html http://reelwebdesign.com/press-release-writing.html
Redirect /pay-per-click-management.html http://reelwebdesign.com/PPC-management.html
Redirect /local_SEO_packages.html http://reelwebdesign.com/local-SEO-packages.php
Redirect /web-design-services.php http://reelwebdesign.com/web-design-services.html
Notice the 404 Error Document is telling the browser to go to my 404.html file. This is another handy feature to implement in your .htaccess file.
Happy redirecting!