301 Redirect
The 301 redirect is a method of informing both human visitors and search engines that an old URL has been moved. Basically, the 301 redirect indicates that the document was moved permanently. This redirect can be integrated into the PHP code, .htaccess file, ASP, etc.
Sponsored links
PHP 301 redirect
The following code must be placed before anything is generated as output. Actually, all headers must be sent from the server to the client before anything else. It is possible to work with databases to include other scripts and so on. The $new_url variable (see the code below) can contain any value (assuming it is a valid URL), so a link to internal page (http://example.com/page.php) is fine. Moreover, a new URL can be dynamic. Just avoid using & because it will not work properly. Instead, use & .
<?
$new_url = “http://www.domain.com/page.php?do=1&p=4″;
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: $new_url” );
?>
.htaccess redirect
This kind of redirect can be a little tricky because if you want to redirect a particular page only, you should know regular expressions. For example, the following code will redirect everyone who typed http://your_domain.com/anything into the browser to http://www.your_domain.com/anything.
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^your_domain.com [nc]
rewriterule ^(.*)$ http://www.your_domain.com/$1 [r=301,nc]
I personally recommend the PHP 301 redirect because it is possible to achieve the same goal without studying regular expressions. With the PHP functions substr, strpos, strlen and a few server’s parameters ($_SERVER), it is very simple.
When is the 301 redirect necessary?
If you just bought a website along with it’s content, or if you are updating old URLs of your website, you are likely to need a 3o1 redirect. For example, if the site is more than a month old, it’s possible that someone has bookmarked it or linked to it. All URLs without a proper redirect would instantly become broken URLs, and return a 404 error (page not found). Moreover, if your website receives organic traffic from search engines, all those visits will also end up with a 404 error.
As it’s already mentioned above, the 301 redirect means “moved permanently” which gives all the weight of the old URL to the new destination (the weight being age and incoming links). You probably already know that older documents rank better than new documents in Google. Without the 301 redirect all your progress so far would be lost. With the 301 redirect you avoid losing any position.
Types of redirect
In general there are a few common types of redirect. Meta, JavaScript and redirects based on headers (mentioned above). Although all redirects work the same way for a human visitor, they’re not equal in terms of SEO. The absence of the “moved permanently” aspect is very important, so it’s not recommended to use meta or JavaScript redirects when indicating that the web document was moved permanently. For instance, JavaScript redirects are suitable for advertising purposes. Meta redirects can be used for applications where the visitor wants to see updated data every 30 seconds, for example.

Where is the social media opportunity in your organisation?
...And Web Developers
WANTED: Web Designers
Technical Project Managers step forward.
How agencies help brands with "social"