• 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

unable to load your default controller on Codeigniter

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'name' cannot be null

Laravel with App Engine Standard Class 'FacadeIgnitionIgnitionServiceProvider' not found

The "client_reference_id" argument is not passed

HTML + PHP + PHPMAILER

How can I get user id from session in javascript?

How can I make good efficent AJAX live forms with just jQuery and

Laravel-fopen: failed to open stream: Permission denied

How to change product Image when variables are selected in Shop and Archive Pages?

Send same name multiple checkbox values via ajax

How to reset Laravel AuthManager/guards in between API calls in tests?

Zig-zag scan an N x N array

OAuth2 Token PHP

Getting public posts of a random user from Facebook API

Last order would be re-order in wooCommerce. How is it possible?

About Contact Privacy policy Terms and conditions