Logo Luan Morina
Redirect users to another page

To redirect a user to another page using PHP, you can use the header() function. This function sends a raw HTTP header to the browser, which can be used to redirect the user to a new page. Here’s are two simple examples:

Redirect to another page

<?php
header("Location: /folder/page.php");
exit();
?>

Redirect if the page has been moved permanently

<?php
header("Location: http://www.domain.com/another-page.php", true, 301);
exit();
?>
   Redirect users to another page with PHP