• 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 properly set "0000-00-00 00:00:00" as a DateTime in PHP

Eloquent insert id with sequence next value

how to get value from array in laravel

Why "Class 'GuzzleHttpClient' not found" even after Installing it in Laravel?

Can't find vendor/autoload.php for Ratchet

Unable to match results of php hash_hmac() and coldfusion hmac()

How to redirect to another page and call a Function there on Angular ng-click

JSON Render Issue in Date Object Laravel and PHP 7.4

How to get quarter for future date using Carbon?

Laravel Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) on a sub query with "ROW_NUMBER() OVER PARTITION"

phpseclib 2.0 can not use Composer to create autoload

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

PHP array_filter with arguments

Required field only if another field has a value, must be empty otherwise

Display the WooCommerce product price inside a custom function

About Contact Privacy policy Terms and conditions