Redirect in PHP
PHP Redirect
To make the user access a particular address of your site redirect to another address, inside or outside your site, you must use the location: parameter of the header () function. Here is an example of the basic use of this function:
As above, whenever the user accesses the page that contains the above code, it will be redirected automatically to link
a>.
Redirection is not restricted to absolute site addresses, and you can also redirect to folders within your FTP, or even files that are in the same folder using a path relative to it.
To better illustrate this, let's create a script that will capture the address it is accessed to, and redirect the user to another one according to this access address.
Remembering that for the above script to work, all the entries used in the script should be created in DNS.