• 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

WooCommerce: Add/display Product or Variation custom field everywhere

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

How to average columns of data from multiple, flat arrays?

Unsure why I am getting: Number of variables doesn't match number of parameters in prepared statement

Call authenticate manually in router middleware

PHP/HTML: Creating A SubMenu

Laravel Nova Dependency Container what are the allowed resource properties other than id in dependsOn

How to add a custom field to all Woocommerce attribute terms using add_action

Get Header Authorization value of a login api (sent with username and password in json body) using php curl

Check if my GET request has Header: Token

printing all running session variable in laravel 5.1

How to remove Deprecated SymfonyComponentDebugDebugClassLoader?

How to make a array inside array?

woocommerce_wp_select options array from product attribute terms

display WooCommerce “Add to cart” button with short-code [add_to_cart ] dynamically

About Contact Privacy policy Terms and conditions