|
|
Redirect traffic to another web page - Apache
|
Views : 249
|
|
Tagged in : Apache
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
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]
|
|
By Rekha, On - 2010-02-09 |
|
|
|