Last active
April 5, 2017 07:55
-
-
Save ictlyh/0fab7a2da38e212cc62f3fe090fc2093 to your computer and use it in GitHub Desktop.
PHP page redirect with parameters
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 | |
/* redirect mutouxiaogui.cn/blog to stay-stupid.com, the parameters remain unchanged */ | |
/* notify search engines that a page has been permanently moved to another location */ | |
header('Status: 301 Moved Permanently', false, 301); | |
/* redirect to another page */ | |
$redirect_url = 'http://stay-stupid.com/'.basename($_SERVER['REQUEST_URI']); | |
header('Location: '.$redirect_url); | |
/* Make sure that code below does not get executed when we redirect. */ | |
exit(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment