Translate some urls in redirect from Gitea to GitHub
This commit is contained in:
7
github-redirect/index.php
Normal file
7
github-redirect/index.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
$uri = $_GET["uri"];
|
||||
$uri = preg_replace('/(\/bbaovanc\/.*?(?=\/))\/src\/(commit|branch)/', '$1/blob', $uri);
|
||||
$uri = preg_replace('/(\/bbaovanc\/.*?(?=\/))\/(commits|blame)\/(branch|commit)/', '$1/$2', $uri);
|
||||
header('Status: 301 Moved Permanently');
|
||||
header('Location: https://github.com' . $uri);
|
||||
?>
|
Reference in New Issue
Block a user