Redirect traffic to another web page

by Rekha 2010-02-09 14:56:09

HTML Meta Rrefresh:
<meta http-equiv="refresh" content="0;url=http://hiox.org"/>

This technique will work in any HTML, and causes the browser to instantly load the site specified after url=. To introduce a delay, increase the number after content=; Typing a 5 would mean 5 seconds before redirection.

Apache Redirect:
You can type the following into a .htaccess file to send anything matching the first URI value to the second URL:
Redirect /path-to-redirect http://hiox.org/

This would reroute, for example, http://yoursite.com/path-to-redirect/index.php to http://hiox.org

PHP HTTP Header Redirect
In any PHP script, before actual HTML output has started, you can use the header() function to insert a location header, instantly redirecting the browser:
header('Location: http://hiox.org/')


Apache mod_rewrite Redirect
This is the most difficult but powerful of these four methods. In the example below, with code living in a .htaccess file, any traffic will redirect to modwest.com. Your imagination and the documentation above can produce other endless possibilities.
RewriteEngine On
RewriteRule .* http://hiox.org [R]

Tagged in:

1068
like
0
dislike
0
mail
flag

You must LOGIN to add comments