Theodoros Emmanouilidis

Notes & Thoughts

Search Engine Friendly Redirection


You already have a working site with tons of content and good search engine rankings. What if you need to change your domain name or change the URL base of the site? That would mean that you will loose all current rankings and practically start over building your search engine rank. This would be the case, par example, if you have a forum residing to the path and you want to move your forum to to the root of your domain

Fear not, you can do this and keep all current search engine rankings using a “301” redirect. “301” redirect is the most efficient and search engine friendly method for webpage redirection. The code “301” is interpreted as “moved permanently” informing the Internet that the original web address has moved permanently to a stated new web address.

Many ways exist to implement a “301” redirect and the choice of the best one depends greatly on the programming language one is familiar with and the exact case that the redirection is needed. I prefer two ways, using PHP or an .htaccess file, depending on the case.

PHP method

Just put an index.php file to the root directory of your old domain containing the following :

header( "HTTP/1.1 301 Moved Permanently" );
header( "Status: 301 Moved Permanently" );
header( "Location:" );
exit(0); // This is suggested to avoid any accidental output

This method will also work if you haven’ t moved your site to another domain but just changed the URL base of your site.

Pages: 1 2

posted under Web Servers

Email will not be published

Website example

Your Comment: