• 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

How to Display Data in Yajra Datatables Laravel 7?

could not find driver Debian SQL Server PHP

Laravel 5.2: Unable to locate factory with name [default]

Return new collection without modifying original collection

How to identify whether webp image is static or animated?

PHP Discord OAUTH2 code sample not working

VichUploaderBundle error "Expected argument of type "File", "NULL" given" when submitting the form without selecting any file

PHPExcel file download using AJAX call

PHP-Sort array based on another array?

Passing a boolean value from checkbox in Laravel form

str_word_count() function doesn't display Arabic language properly

How to execute sql code based on fetch array

Symfony - "framework.test" config is not set to true

Wordpress 'post_type_link' hides permalink

Laravel update hasMany relationship using saveMany

About Contact Privacy policy Terms and conditions