• 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

The sum of the user's points

PHP cURL (SSL certificate problem: self signed certificate in certificate chain)

PHP's array_map including keys

Check if a string contain multiple specific words

How to convert the int value to inch in PHP [closed]

Eloquent insert id with sequence next value

PHPExcel export HTML table to xlsx

php curl_exec() Connection refused when retrieving a remote image

Symfony Mercure "Failed to send an update"

Laravel - How to properly generate unique slugs from article titles?

Utf8 encoding issue with Laravel

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

How to insert Google Adsense Code in PHP script?

if statement inside concatenation

Unable to create lockable file - Laravel 8 & PHP 8

About Contact Privacy policy Terms and conditions