Skip to content

Instantly share code, notes, and snippets.

@ictlyh
Last active April 5, 2017 07:55
Show Gist options
  • Select an option

  • Save ictlyh/0fab7a2da38e212cc62f3fe090fc2093 to your computer and use it in GitHub Desktop.

Select an option

Save ictlyh/0fab7a2da38e212cc62f3fe090fc2093 to your computer and use it in GitHub Desktop.

Revisions

  1. Yuanhao Luo revised this gist Apr 5, 2017. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions redirect.php
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,13 @@
    <?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();
    ?>
  2. Yuanhao Luo created this gist Apr 5, 2017.
    7 changes: 7 additions & 0 deletions redirect.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    <?php
    /* redirect mutouxiaogui.cn/blog to stay-stupid.com, the parameters remain unchanged */
    header('Status: 301 Moved Permanently', false, 301);
    $redirect_url = 'http://stay-stupid.com/'.basename($_SERVER['REQUEST_URI']);
    header('Location: '.$redirect_url);
    exit();
    ?>