Search Engine Friendly Page Redirects

Moving website pages is not only a traumatic experience but it actually does your website more harm than good when not done right. The Google Search algorithm uses over 200 elements to rate your website and one of these elements is how reliable your website pages are. When a “Page Cannot Be Found” message is displayed, this is one mark less for your website which means that your search ranking will likewise be affected.  If you need to redirect your Web pages, then you need to do it in a way that search engine spiders and visitors will find it “friendly.”

PHP Redirect Code

Using the PHP redirect method requires that you call the “header ()” first before anything else. Nothing else, even an “include ()” statement or an empty space, should be allowed before the “header()” is executed. The code examples below show the right way of implementing this:

header (“http/1.1 301 Moved Permanently”);
header (“Location:”);

The first header information tries to figure out the HTTP status code that should be sent when missing files are found. The information in the second line is sent back to the browser together with the status code.

Some developers skip the first line entirely and just go with the second line as shown below:

Header (“Location:”);

While this redirect may work, it will result in a “302 Moved Temporarily” redirect message instead of a 301 redirect. This is not a Search Engine friendly redirect and should be avoided.

JavaScript Redirect

JavaScript redirects allow for a lot of flexibility when it comes to redirects. For example, it is easy to implement a timed delay redirect that forwards visitors to a new web page after a set time. With JavaScript, you can redirect all your visitors to a new URL using the script below:

<script type = “text/javascript”>
Window.location =

To implement a timed delay redirect using JavaScript, use the code below:

<script type = “text/javascript”>
Function delayer() {
	Window.location = “../javascriptredirect.php”
//- - >
<body onLoad = “setTimeout (‘delayer ()’, 5000)” >
<h2> Redirection in 5 Seconds! </h2>
<p> Please update your bookmarks to reflect our new website! </p>

HTML Redirect Code

When redirecting using HTML, you need to ensure that any tricks that are targeted towards Search Engines may get you banned.  Ensure that only the code below is placed inside the <Head> and </Head> tags of your HTML code:

<meta http-equiv="Refresh" content="5”; url=">

The “Content=”5”” parameter tells the browser to wait for 5 seconds below redirecting to “”

Redirection using .HTACCESS file

.htaccess file is a configuration system file. With this file, you can redirect an entire site to a different URL, a single file to a specific subfolder, or redirect old files to new paths.

Online Tools

Some online SEO resources are able to automatically check if your redirects can be crawled correctly and that the redirects have been set up right. Once you make a redirection, use these tools (e.g. to ensure that your redirects are Search Engine friendly.

Regardless of what method you use, permanent redirects are more search engine friendly than temporary redirects which should be avoided if possible.

Home CSS Deals HTML HTML5 Java JavaScript jQuery Miscellaneous Mobile MySQL News PHP Resources Security Snippet Tools Tutorial Web Development Web Services WordPress