How to make a redirect in PHP

Share This Post

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: http://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

spot_img

Related Posts

5 Reasons That Make MacBooks Good for Coding

Looking for a reliable laptop or computer for coding?...

Python for Loop Iteration: How to Easily Manipulate a List

One of the most powerful features of the Python...

How To Get First Characters of a String in Python

Way to find the first characters of a string...

How To Convert Tuple To String In Python

In this post, you will learn how to convert...

How To Convert String to Double in Python

Good to hear, that you want to convert a...

Python TypeError: String Index Out Of Range Solution

A string is an array of characters and part...
- Advertisement -spot_img