Our Thoughts, Views and Everything else
301 Redirect – How to Keep Your Google Rankings Going From html to php
Posted on Nov 20, 2011 by bullseye1

The Critical 301 Redirect 

The 301 redirect is the most efficient and SEO-friendly method for website page redirection. It’s the simplest method, not that hard to implement, and it should preserve your valuable search engine results page rankings for all of your website urls.  If you have to change file names or move pages around, it’s the safest option. The code “301” is interpreted by the search engine indexing spiders as the page has moved permanently.

This is a common problem for many companies going from a radically different new website structure.  Many of our company’s website pages had page one ranking on Google, Yahoo, and Bing for many keyword phrases having to do with SEO, pay per click, and website development in our targeted regional market before the advent of our new website. When our company converted all of our website urls from .html to .php on the new site, we were a bit concerned that somehow Google would not find or not correctly identify what new pages corresponded to the old pages thereby lowering our precious Google rankings for all pages and hurting the new business leads that we receive from the Internet. 

The problem was solved by using a 301 redirect for each page of the old site in conjunction with a .htaccess file placed at the root level of our server.

Note: This type of 301 redirect applies only for page conversions going from html to php or html to html.

First, create the .htaccess file.  What is the .htaccess file? An htaccess file is a simple ASCII file, such as you would create through a text editor like NotePad or SimpleText. It’s a web server configuration file that is used to control the behavior, security, and performance of a site.  Most webmasters create .htaccess file and use this file to control their sites and communication with search engine spiders.

Open up a text editor and save as “.htaccess”. 

The following is the 301 redirect command that should be placed in the .htaccess file. to match old page to new page:

Redirect 301 /old-url.html 

You will have a 301 redirect line of code for each old url that you want to redirect to its new url in the .htaccess file.

A quick way for websites under 500 pages to get all of the urls concerned in this process of matching old pages to new pages is to use this free xml sitemap tool on both the old and new sites, extracting the xml operators, copying and pasting into a spreadsheet, matching the old to new pages, then adding “Redirect 301” to the beginning of each cell.  This sitemap generator is great for use with Google Webmaster Tools, also, to communicate all of your website pages directly to Google.

Then upload the .htaccess file to the root level of your server.

One final step.  You’ll we need to instruct the server that mod_rewrite is one of the rules to initiate to execute .htaccess.

The mod_rewrite module uses a rule-based rewriting engine, based on a regular-expression parser, to rewrite requested URLs on the fly. By default, mod_rewrite maps a URL to a filesystem path. However, it can also be used to redirect one URL to another URL, or to invoke an internal proxy fetch.

mod_rewrite provides a flexible and powerful way to manipulate URLs using an unlimited number of rules. Each rule can have an unlimited number of attached rule conditions, to allow you to rewrite URL based on server variables, environment variables, HTTP headers, or time stamps.

mod_rewrite operates on the full URL path, including the path-info section. A rewrite rule can be invoked in httpd.conf or in .htaccess. The path generated by a rewrite rule can include a query string, or can lead to internal sub-processing, external request redirection, or internal proxy throughput.

Helpful information for:

How to retain your Google rankings when your website urls change. How to not lose your website rankings or keyword rankings on the search engines. 301 redirect. .htaccess and 301 redirect. How to redirect pages to keep your rankings on Google. How to keep your Google rankings. html to php redirection. xml sitemap.

Add a comment

You may use these HTML tags and attributes:
HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>