Skip to content
Home » How to make a redirect in PHP

How to make a redirect in PHP

  • by
redirect-image

Greetings everyone, Today our topic redirect in PHP. In this article we will learn how to redirect from the home page to the about page in PHP so, let’s go started.

If you want to go another page you can easily use header() this is a built-in function of PHP  which do use to send the raw HTTP  header to the users.

HTTP stands for (HyperText Transfer Protocol) now I want to go home page to the about page I use to URL will go to another page see the example below.

<?php

header("Location: https://www.wholeblogs.com");

exist();

?>

Now I reached at the wholeblogs.com so, redirect the user from chrome to home page on perpetual base and then it also mentions the HTTP response code into header( ) function such as seen in the example below.

The SEO Stands for Search Engine Optimization throw  “page rank” from the home page to the about page.

<?php

// 301 Moved Permanently

header("Location: https://wholeblogs.com/header-function-in-php/", true, 301);

exit( );

?>

Read more: header() Function in PHP

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *