1<?php
2// This will just redirect you to example.com
3header("Location: https://example.com");
4?>
1<?php
2// This will just redirect you to example.com
3$url = "https://example.com";
4header("Location: $url");
5?>
1<?php
2/*
3 This will redirect to facebook.com
4*/
5$url = "https://facebook.com.com";
6header("Location: $url");
7exit;
8?>
1
2<html>
3<?php
4/* This will give an error. Note the output
5 * above, which is before the header() call */
6header('Location: http://www.example.com/');
7exit;
8?>
9
10
1/*
2This will just redirect you to example.com
3*/
4
5<?php
6$url = "https://example.com";
7header("Location: $url");
8exit;
9?>
10
11/* I hope it will help you. Namaste */