mirror of
https://github.com/thewesker/greptweet.git
synced 2025-12-22 04:51:05 -05:00
Redirect to fetch if there is an issue
This commit is contained in:
11
www/404.php
Normal file
11
www/404.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if (preg_match('#^/u/#', $_SERVER["REQUEST_URI"])) {
|
||||
$username = basename($_SERVER["REQUEST_URI"]);
|
||||
if ((!empty($username)) && (strlen($username < 16)) && preg_match('/^[A-Za-z0-9_]+$/', $username)) {
|
||||
header("Location:http://" . $_SERVER["HTTP_HOST"] . "/f/" . $username);
|
||||
die();
|
||||
}
|
||||
}
|
||||
?>
|
||||
<img style="width: 20%;" src=/icons/greptweet_birdie.svg>
|
||||
<h1>Error <?php echo $_SERVER["REQUEST_URI"]; ?></h1>
|
||||
Reference in New Issue
Block a user