• 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 override htaccees file for cache control header

Limit of log line written to Apache Errorlog from mod php error_log

PHPUnit 7: Failed asserting that exception of type InvalidArgumentException is thrown

retrieve data from database using session

PHP code for generating decent-looking coupon codes (mix of letters and numbers)

Can I write PHP code across multiple lines per statement?

Facebook SDK error: Cross-site request forgery validation failed. Required param "state" missing from persistent data

codeigniter 4 running error first time with xampp

How to make autocomplete work in foreach php loop? (vscode, intellisense)

Invalid value in field "itemtype" in Google Search Console

Insert a DIV after the 6th product only once in WooCommerce category archives

Target class controller does not exist - Laravel 8

oauth-private.key does not exist or is not readable

Transpose and flatten two-dimensional indexed array where rows may not be of equal length

protect my blog content

About Contact Privacy policy Terms and conditions