• 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

Laravel - Implicit route model binding with soft deleted data

Limit login attempts in Laravel 5.7

How to properly set "0000-00-00 00:00:00" as a DateTime in PHP

Laravel multi auth - Authentication user provider [] is not defined

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

Error Class "LaravelFortifyFeatures" not found

Timber: Single post pagination does not work (wp_link_pages)

Remove "estimated for {country}" text after tax amount in Woocommerce checkout page

PHP 8 - libxml_disable_entity_loader() has been deprecated. How do I replace the functionality it provides?

get folder directory from input type file - PHP

Unable to run composer install

How to update array value in Laravel

HTML and PHP in one file

Symfony/Form add attribute based on the data

Read users and passwords from a txt file

About Contact Privacy policy Terms and conditions