• 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

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

Install mysql client in docker image

Make certain characters of a word from string bold

WordPress + Nginx on non-standard port behind AWS ELB results in broken links

Reading input in php from terminal

Magento 2 - How to add new block to admin panel in product page?

Edit product hook WooCommerce

PHP and WebView - Cookie doesn't are the same

Popup Window and PHP form

Codeigniter, Severity: error --> Exception: Too few arguments to function, admin dashboard shows HTTP error 500

How do I set the maximum php memory limit

Fatal error: Trait 'LaminasDbAdapterLaminasDbAdapterAdapterInterface' not found in /var/www/vendor/laminas/laminas-db/src/Adapter/Adapter.php

MISSING UPDATES FOR: MEDIA Drupal 9

Boolean assignment operators in PHP

PHP7 CLI attempts to load xdebug twice - "Cannot load Xdebug - it was already loaded"

About Contact Privacy policy Terms and conditions