+1 (561) 283 4241 +91 (79) 26923254


Keep track and join the conversation
on our blog.
Request a Quote
Get one stop Solution For All your web design, development Digital Marketing and other many more services
Required All Field

Please leave this field empty.


20th Sep 2008
How to Redirect Web Page using 301 Redirect in Search-Engine Friendly Way.

As I had told in my last post – HTTP Response Codes and SEO , today I am going to throw some light on how can we redirect a web page in various programming languages in a search-engine friendly manner.

Use of meta tag refresh redirection has been abused for uses in relation to SPAM. Consequently, that page will be de-indexed from every search engine. This also applies to javascript redirection. Search engines can easily detect javascript and meta tag redirection, so just dont do it, use the 301 redirect.

If you have just redesigned some pages having high search engine rankings that you don’t want to lose, then how can you safely redirect web site traffic from your old pages to the new pages without losing your rankings? You can do this by using a “301 redirect”.

301 Redirect

301 redirect is the most efficient and search engine friendly method for webpage redirection. If you have to change file names or move pages around, it’s the safest option. Moreover, it also not tough to implement it. The code “301” is interpreted as “moved permanently”. Following are the methods of URL Redirection:-

Apache Web Server .htaccess file

Apache .htaccess files let you override the Web server configuration on a per-directory hierarchial basis, and are active in the creation of proper 301 redirects. For more information, consult the Apache .htaccess Tutorial and the Apache URL Rewriting Guide.

Single Page Redirect:

Redirect 301 /old/url /new/url
Redirect Permanent /old/ur /new/url

Canonical Hostname Redirect (non-www to www):

This solution will redirect any page requested via a non-www domain to the same URL with the www domain, and as such it can be placed in the DocumentRoot of your site and will be enforced globally:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

The same thing can also be accomplished through Google Webmaster Tools as follows:-

1. Click on the site url from dashboard.
2. Go to Tools -> Set Preferred Domain.

What is a .htaccess file?

Web server checks for a .htaccess file when a visitor/spider requests a web page. The .htaccess file contains specific orders for certain requests, including security, redirection issues and how to handle certain errors.
How to implement the 301 Redirect?

1. Open notepad, name and save the file as .htaccess.
2. If you already have a .htaccess file on your server, download it to your desktop for editing.
3. Place this code in your .htaccess file:
redirect 301 /old/old.htm http://www.you.com/new.htm
4. If the .htaccess file already has lines of code in it, skip a line, then add the above code.
5. Save the .htaccess file
6. Upload this file to the root folder of your server.
7. Test it.

Please keep following things in mind:-
– Don’t add “http://www” to the first part of the statement
– Place the path from the top level of your site to the page.
Also ensure that you leave a single space between these elements:
redirect 301 (the instruction that the page has moved)
/old/old.htm (the original folder path and file name)

http://www.you.com/new.htm (new path and file name)
When the search engines crawl your site again they will follow the rules mentioned in your. htaccess file. The search engine spider actually recognizes the response from the server as valid. During the next update, the old file name and path will be dropped and replaced with the new one. Sometimes you may see alternating old/new file names during the transition period, plus some fluctuations in rankings.

Get in touch with us for web analytics, SEO services, web development and Website Designing in India.


I read this post completely on the topic of the difference of most recent and preceding technologies, it's amazing article.

Please leave this field empty.