• 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

Laravel Jetsream Profile page not loading on fresh install

Laravel implode array items to new lines

passwordless LDAP login and get user information using Kerberos ticket in PHP

Generate random username based on full name php

Boolean assignment operators in PHP

Symfony Error: "An exception has been thrown during the rendering of a template"

Updating and Synchronizing Woocommerce Subscriptions to Custom Date

How to modify CSS in a specific page of the WP admin dashboard (backend)

What is the difference between client-side and server-side programming?

Xdebug can't connect back to Docker host

Require a class from another class - php

PHP my timezone is no setting up in PHP.ini File in xampp

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

Load a .env file with PHP

PHP usort() order in case of equality

About Contact Privacy policy Terms and conditions