• 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

PHPExcel export HTML table to xlsx

PHP file_get_contents function

Not able to override collapsible.js in magento 2

I'm trying to write a clean url for my website using the $_SERVER['REQUEST_URI'] in php

array_map triple dimensional array [duplicate]

Refresh specific HTML content that retrieves data from MySQL

PHPMetrics option --excluded-dirs="myfolder" : myfolder dir is not excluded within docker

How to send upload image through email

Xdebug in Laravel is not working with VSCode

getting error while enter Command => php artisan route:list

How to auto populate preferredCountries from intl-tel-input with db output

renameColumn migration fails for existing column with columns does not exist error

How to test a php login connected to a mysql db through xampp?

Generate random username based on full name php

laravel 5.6 bulk inserting json data

About Contact Privacy policy Terms and conditions