• 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

Convert date and time to Jalali in Laravel

Magento Installation SQLSTATE[HY000] [2002] No such file or directory error

Laravel Carbon throws error The format separator does not match

Woocommerce redirect after add-to-cart error

"Mixed content blocked" when running an HTTP AJAX operation in an HTTPS page

Combine array with same value and add other [duplicate]

Only on Firefox "Loading failed for the <script> with source"

How do I upload a laravel project on cPanel shared hosting?

Best way to scrolldown onpageload

selected value from the listbox in php

Converting IPv6 to IPv4 address in PHP

Having issue with matching rows in the database using PDO

HTTP Range requests with php for Video Embedding for solving going to specific time in video (seek bar not work)

Composer Warning: openssl extension is missing. How to enable in WAMP

Undefined variable in Laravel 8 project (php 7.4)

About Contact Privacy policy Terms and conditions