Skip to content

Instantly share code, notes, and snippets.

@umorigu
Created March 6, 2011 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umorigu/857109 to your computer and use it in GitHub Desktop.
Save umorigu/857109 to your computer and use it in GitHub Desktop.
PukiWiki: /pukiwiki.php?... へのアクセスを /?... へ301リダイレクトする
<?php
$request_uri = $_SERVER['REQUEST_URI'];
$uri = preg_replace("/\/pukiwiki\.php/", "/", $request_uri, 1);
header("HTTP/1.1 301 Moved Permanently");
header("Location: $uri");
echo $uri;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment