• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

PHP header location absolute URL

php


PHP Snippet 1:

header("location:http://www.example.com/path/to/myfile.php");
exit;

PHP Snippet 2:

$url = $_SERVER["HTTP_HOST"]."/path/to/myfile.php";
header("location:".$url);
exit;

Related Snippets

Move a child array to parent array and change parent/child name

Unsure why I am getting: Number of variables doesn't match number of parameters in prepared statement

How to find phpcs current default standard

Array to string conversion

Laravel Jetsream Profile page not loading on fresh install

Using array_intersect on a multi-dimensional array

Sliders in Laravel

PHP: How to quickly split a key=value file into associative array

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

Assign output of PHP function to a variable

PHP how to detect if running on arm64 cpu?

Show only featured products in Woocommerce shop page

Need to display only array value in JSON output

How to get an Array value inside an object in an array Php [duplicate]

GRPC installed successfully on ubuntu but php is looking for it in another folder

About Contact Privacy policy Terms and conditions