Website Redirection – Create a 301 Permanent HTTP Redirect in htaccess

Website Redirection - HTTP RedirectIf you are moving from an old domain to a new domain you will need to redirect all your old blog posts and website pages to the exact same posts & pages on your new domain.

If you don’t redirect all page & post URL’s correctly. you’ll suffer a significant fall in search engine rankings and traffic.

Creating a 301 redirect in cPanel will only redirect your old domain to your new domains homepage and NOT redirect your readers to the content they are searching for.

HTTP Redirect in htaccess

You’ll also need use Apache mod_rewrite to create http redirect code in your htaccess file.

You’ll need to contact your web host and speak to a server engineer, in my case this was a Linux administrator.

Here’s a list of Apache ModRewrite examples

I used one of these examples to effectively redirect all URL’s from my old domain to my new domain’s exact URL’s.

This is the exact code which he placed in the htaccess file in my public_html root directory of my old site.

301 Redirection Mod Rewrite Apache

You may also need to create a 301 permanent wild card redirect in cPanel

Create a 301 Redirect in cPanel

Login to cPanel and navigate to Domains > Redirects

Domains - Redirects

Create a New Redirect

Add a New Redirect

To add a new redirect from your old domain to your new domain:

  1. Select 301 Permanent Redirect
  2. Select old domain
  3. Enter new domain URL
  4. Select with or without www
  5. Select Wild Card redirect

You’ll then see the redirect displayed in current redirects.

Test that it works ok by finding your links in the search engine results and clicking thru.

Other Redirection Solutions


Comments

2 responses to “Website Redirection – Create a 301 Permanent HTTP Redirect in htaccess”

  1. SheriG Avatar

    We use Hubspot’s Marketing Grader tool to check on our website’s condition, and as we’ve been working down the list of areas for improvement, one of the areas we’ve been having trouble addressing was this:

    Oops, looks like you’re missing a 301 redirect. To a search engine, “craigslist.com” and “www.craigslist.com” are not the same thing. Set up a permanent redirect (also known as a “301 redirect”) so that you get full credit for what’s on your site, no matter how it’s accessed.

    I’ve been trying to figure out how to address this, and of course your blog had something I could use. I’ve put in the re-direct for all the sites we manage, and if it works, we should get an “all clear” from Hubspot in a few days.

    If not, I’ll be back to look for a different solution.

    Thanks for all you do ;o)

  2. […] Create a 301 Permanent HTTP Redirect in htaccess […]

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.