Lunarpages Internet Solutions Blog
  • Home
  • About Us
  • LunarForums
  • Free Web Tools
  • Free WP Themes
1

Golden Rule on Redirects to Keep Google Happy

13 March, 2009 - Mitch Keeler, Web Hosting

Let us say Joe has an old web site, but he wants to change his main domain name and the location of a few pages on his web site.  There are a dozen different ways to redirect a web site, but what would be the best way to get this done?  You want to use what is called a 301 redirect.  Now why is this the best one to use? Well, because Google says so. 

To do the 301 redirect for your main domain name, you can copy/paste this code into your .htaccess file (if you are on an Apache-based server):

RewriteEngine On

RewriteCond %{HTTP_HOST} ^.*youroldwebsite\.com$ [NC]
RewriteRule ^(.*)$ http://www.yournewwebsite.com/$1 [R=301,L]

To simple redirect a single page, you can copy and paste this code into your .htaccess file:

Redirect 301 /old.html http://www.exampledomain.com/new.html

Of course, please remember to change the example names and file paths to meet your own needs.  For more help on rewriting address locations, check our the URL Rewriting Guide on Apache.org.

  • http://www.webhosteditor.com Web Hosting Blog

    True, im using the second code but not only for redirects, also for masking the affiliate links I have, since google is not a big fan of affiliates links now adays.

Archives

Categories

View more:

  • About the Lunarpages blog
  • Best Blog Hosting Guide
  • BOTW.org 40% Discount
  • Contact Lunarpages
  • Free Online Tools
  • Free Webmaster Downloads
  • Free Wordpress Themes

Best Web Hosting

Lunarpages.com Web Hosting

Recent Posts

  • Customer Showcase – SportVision
  • 5 Mobile App Trends for 2012
  • 10 Technology Trends for 2012
  • 5 Open Source CMS for Websites
  • Google Will Change Your Web Marketing in 2012

Recent Comments

  • Anonymous on 10 Best Google AdSense WordPress Plugins
  • best seo forums on 5 Reasons Why VPS Hosting May Be the Solution You’ve Been Searching For
  • Roger on 5 Mobile App Trends for 2012
  • Web Hosting Reviews on 2012 Resolutions Promotion
  • Graham Gillen on Plesk 9.5.2 Backup Tutorial

@Lunarpages Feed

Who We Are

  • Web Hosting Services
  • About us
  • Partners
  • Affiliate Program
  • Specials
  • 24/7/365 Support Desk
  • Community Forum
  • WIKI

Our Products

  • Colocation Services
  • Fully Managed Services
  • Dedicated Hosting
  • VPS Hosting
  • Microsoft Exchange
  • Open-Xchange
  • Fax To Email
  • Linux Hosting
  • Windows Hosting
  • Reseller Hosting
  • Quicksite Website Builder
  • SEO & SEM Services
  • Payment Processing
  • SecureLive Website Security
  • Tremendesk - Help Desk Solution

Connect With Us

Stay in touch with us!

Sign up for our monthly newsletter to receive updates, news, and current promotions!

Twitter
Facebook Google+ RSS Feed


© 2000 - 2011 Add2Net, Inc. "Lunarpages", "Add2Net" and the "Lunar Symbol" are the trademarks or the Registered trademarks of Add2Net, Inc.
All rights reserved. Unauthorized use is prohibited.