The code is in your server configuration. If your server is Apache, for instance, you can use the RedirectPermanent or RedirectTemp directives in an .htaccess file:
http://httpd.apache.org/docs/mod/mod_alias.html#redirect http://httpd.apache.org/docs/mod/mod_alias.html#redirectmatch http://httpd.apache.org/docs/mod/mod_alias.html#redirectperm http://httpd.apache.org/docs/mod/mod_alias.html#redirecttemp
The tag you are thinking of goes in a page and is
<html> <head> <META http-equiv="refresh" content="3; URL=http://www.your new site.com"> </head> <body> Please adjust your bookmarks. We'll try and push you to new site in 3 seconds. </body> </html>
The correct/preferred way is to configure your old server to redirect the users. With Apache servers (which are mostly referenced here) there are commands to do that. Netscape and IIS are bit different. The above will work with limitations and can be used to buy time till you discern the preferred (which others have directed you to FAQs)
Greg Hewitt-Long says --
Arun alluded to the most efficient method, and provided links to tutorials - an example or two might make principle a little easier to understand...
An example would be when you want to redirect oldpage.html to newpage.html using .htaccess - the entry would look like this:
redirect 301 /oldpage.html http://www.yourdomain.com/newpage.html
You can create redirects in your site to embedded links using a quick and dirty .htaccess entry - this principle can be used to email long links, or talk clients/visitors through a short link to end up at a longer one - example:
Directing potential customers to the frontpage and following a link to the domain registration of our .htaccess company proved that it's always possible to mess up something you think is absolutely as simple as can be.
E-Mailing a link to the page failed on a couple of customers because the URL was long - causing their email client to wrap the URL and break it.
However, entering the following line into .htaccess
redirect 301 /domains https://www.aaabusinesshosting.com/domain_name_registration/domain_registration.shtml/
and then emailing the short link: http://aaabusinesshosting.com/domains/ to the client, to our secure server domain registration link. This MAY be how the likes of tinyURL.com work - although I suspect a more elegant solution than an ever growing .htaccess file (but you never know...).