Created
November 25, 2015 00:16
-
-
Save gnrfan/2198e0bae816fd40b4fb to your computer and use it in GitHub Desktop.
Redirects all GET query parameters to given URI.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define("BASE_URL", 'http://localhost/index.php'); | |
if (array_key_exists('QUERY_STRING', $_SERVER) && strlen(trim($_SERVER['QUERY_STRING']))>0) { | |
$url = sprintf("%s?%s", BASE_URL, $_SERVER['QUERY_STRING']); | |
} else { | |
$url = BASE_URL; | |
} | |
header('Status: 301 Moved Permanently', false, 301); | |
header("Location: $url"); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment