• 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

PHP code for generating decent-looking coupon codes (mix of letters and numbers)

Yii2 redirecting to previous page after login

Normalize DateInterval in PHP

how to get the header value, if we don't know the value because the value is random from the server

In PHP, which is faster: preg_split or explode?

XSS attack still works despite htmlspecialchars() doing its work

Laravel UUID generation

Populate Dynamic Dropdowns List in Codeigniter

Send Outlook 2010 email using PHP

Implode columnar values between two arrays into a flat array of concatenated strings

Not able to access model in the controller mautic

Timber: Single post pagination does not work (wp_link_pages)

How to solve cURL error 60: SSL certificate in Laravel 5 while Facebook authentication

How to get median and quartiles/percentiles of an array in JavaScript (or PHP)?

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

About Contact Privacy policy Terms and conditions