How to Redirect page using PHP?

by Vikash Sharma May 23 in Other 0 Comments 127 Views


Redirection in PHP can be done using the header() function.


To setup a simple redirect, simply create an index.php file in the directory you wish to redirect from with the following content:


<?php header("Location: http://www.YOUR_WEBSITE_NAME.com/"); ?>


Where 'http://www.YOUR_WEBSITE_NAME.com/' is the URL you wish the users to be redirected too.


Example:

<?php header("Location: https://www.shareanything.in"); ?>