• 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

Adding the custom page with add_menu_page function on Wordpress

I cannot create a auto generated date time in mysql workbench

What's the net::ERR_HTTP2_PROTOCOL_ERROR about?

Smarty if isset

Fatal error: Array callback has to contain indices 0 and 1

best way to store error messages in Laravel (session or variable)

Cannot retrieve error message using Symfony HttpClient if the response is not "ok"

I want a way to give path to my files which are outside of public folder in laravel

Unable to Edit config.inc.php

Webscraping Symfony/Panther: Can't get HTML

error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure

(PHPUnit) PHP Fatal error: Uncaught Error: Call to undefined function each()

Update Total in checkout of Woocommerce with Ajax Request

How can I access an array/object?

PHP and WebView - Cookie doesn't are the same

About Contact Privacy policy Terms and conditions