Automatic redirect (Auto Redirect) on PHP
I do not apply for completeness of a statement of a subject, it in fact clause{article}, instead of the handbook, but for beginning{starting} will be the introduction information in this technics{technical equipment}.
Actually, about the term:
Automatic perepanravlenie the user from page on which he has got on other page or a site. Technically to realize a redirect it is possible a lot of ways. The given mechanism should use only in unusual cases, for the reason, that search engines consider, that the redirect can be used unfair raskrutchikami, involving in such a way an audience on sobstvenyj a site from pages specially created for search machines on pages really containing a useful content that looks as a deceit poiskovikov.
Before the beginning of a narration I shall make small remarks:
* It is not necessary for you to be the PHP-programmer to understand technics{technical equipment} of a redirect;
* It is meant, that the server (be local - localhost, or your hosting on the Internet) supports performance of PHP-scripts.
And in general, if that will be not clear, favour I ask on php.net:)
The essence of technology or technics{technical equipment} of a redirect is automatic perenapravlenie someone somewhere:) And where exactly - you set in a script, thus, at performance of a script he automatically will redirect you on the certain web-address.
It turns out, that transition goes not under the direct link from a site of a kind <a href = " http: // www.google.com "> google.com </a>, and through a script.
1. We open any html-editor (though the notebook will approach also) and it typed{collected} / is inserted in him{it} the following code:
<?
$URL = " http: // www.realcoding.net ";
header (" Location: $URL ");
?>
<html>
<title> RealCoding. Net </title>
<head> </head>
<body>
</body>
</html>
2. Further we save our file with the above-stated code, for example code.php and it is loaded it{him} on the web - server. For example, if you have loaded code.php in a root folder of a site codeguru.com.ua to call a script it is possible on URL http://www.codeguru.com.ua/code.php. After execution{performance} of a script on the server you will be automatically redirected (sredirekteny:)) on a useful site for programmers realcoding.net - as it has been specified in our script.
Still it is possible simply on a site in a body of page (inside tegov <body...> </body>) to put the link of a kind:
<a href = " http: // www.codeguru.com.ua/code.php "> Transition to site Realcoding. Net </a>
Such simple technics{technical equipment} of a redirect (redirect).

|