• 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

Apply session id from request header

woocommerce get_order_report_data to show order_item_id

PHP 8.1: strftime() is deprecated

Symfony - EasyAdmin - Add and remove functions are ignored from AssociationField

using random function but it's displaying duplicates

Ajax GET request fails in laravel 8

PHP Fatal error: Class not found - PHPUnit

Custom Button next to “ADD TO CART” button of WooCommerce based on Product Type

What is the function of the (new Date()).getTime() in PHP?

Laravel get user data with profile

Using array_intersect on a multi-dimensional array

How do I call Validator from a namespace with an already existing Validator class

Laravel Unresolvable dependency resolving [Parameter #0 [ <required> $method ]] in class GuzzleHttpPsr7Request

Laravel phpunit test failing authorization

Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in Unknown on line 0

About Contact Privacy policy Terms and conditions