• 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

if statement inside concatenation

Laravel display validation error

Substitute integers and dots with regex [duplicate]

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

How do I call a php file with axios?

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given [duplicate]

Show Custom Data in Woocommerce Order Details Admin Area

Declaration of OMDb::query(string $statement) must be compatible with PDO::query

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

Call authenticate manually in router middleware

Form repeater send wrong data with last element in Laravel

onKeyUp event calculation not working on the following rows from php generated forms except the first one

Use same method for inertia response and json response Laravel Jetstream

echo language construct is discouraged. (PHP)

Statement that checks whether a URL contains a particular path?

About Contact Privacy policy Terms and conditions