Blog › PHP · Published 2026-11-26

How to make a redirect in PHP

Send a Location header, then stop the script:

<?php
header("Location: https://example.com/new-page", true, 302);
exit;

Official sources

Need help with your project?
We build websites, systems and automation. Start your project WhatsApp

All articles