• 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

Maatwebsite Excel 3.1 : how do I skip duplicate data when imported?

Login if user is active using Laravel Breeze

Alert message after submitting form in PHP

jwt decode throws Invalid argument supplied for foreach() on php-jwt and codeignitor 4

How to get page number on dompdf PDF when using "view"

retrieve data from database using session

Reload parent page after submit in iframe

Laravel Jetsream Profile page not loading on fresh install

Undefined variable in Laravel 8 project (php 7.4)

PHP Startup: Unable to load dynamic library 'openssl' in Ubuntu

Sync Records With Default Values in Pivot Tables, Call to undefined method syncWithPivotDefaults()

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

how to check version of codeigniter framework?

Laravel Route issues with Route order in web.php

php file upload scanning using clamav, permissions on /tmp/

About Contact Privacy policy Terms and conditions