• 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

curl returning 301 error after migrating to https

Override default Auth routes in Laravel 7

Is there an equivalent of DynamoDB on Azure as a PHP session Handler

Facebook SDK error: Cross-site request forgery validation failed. Required param "state" missing from persistent data

Find out the name of the last script that included the current one

CodeIgniter extend CI_URI undefined method

Pages are working fine on localhost but not running on the hosting server

Update Total in checkout of Woocommerce with Ajax Request

Comma separated list from array with "and" before last element

How can i update or reset my password without entering email field in laravel-8?

How to retrieve Active Directory group policy maximum password age using LDAP

How in Laravel run JavaScript code stored in php variable?

How to run or debug php on Visual Studio Code (VSCode)

Upgrade PHP on AWS Linux

mysql slow on updates for a well optimized query

About Contact Privacy policy Terms and conditions