• 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

How to make a array inside array?

how to remove %20 in the url in php

Warning: mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables 11 [closed]

Cannot pass null argument when using type hinting

Installing Composer - Internal Error

How to install PHP composer inside a docker container

Access relation of pivot table in Laravel

MOODLE: What does it mean to aggregate h5p assets?

WordPress + Nginx on non-standard port behind AWS ELB results in broken links

merge all files in directory to one text file

Converting IPv6 to IPv4 address in PHP

browsersync doesn't work with XAMPP

PHP: How to solve ob_start() in combination imagepng() issue?

PHP - installing Xdebug on Mac with XAMPP (Unix File)

Log a user out of a website when they put their computer to sleep

About Contact Privacy policy Terms and conditions