Initial commit

Change-Id: I3efa93e88134ba66252344e77239ee11ec4bcd2d
diff --git a/.gitreview b/.gitreview
new file mode 100644
index 0000000..ca8a932
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.avm99963.com
+port=29418
+project=iavm.xyz
+defaultbranch=main
diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..5ce24b4
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,3 @@
+RewriteEngine On
+RewriteCond %{REQUEST_URI} !^/?index.php$
+RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..a7511b6
--- /dev/null
+++ b/index.php
@@ -0,0 +1,13 @@
+<?php
+require_once('redirects.php');
+
+$path = $_GET['q'] ?? '/';
+foreach ($redirects as $r) {
+  if (preg_match($r['pattern'], $path) === 1) {
+    $location = preg_replace($r['pattern'], $r['redirect'], $path);
+    header('Location: '.$location);
+    exit;
+  }
+}
+
+http_response_code(404);
diff --git a/redirects.php b/redirects.php
new file mode 100644
index 0000000..c0efb5a
--- /dev/null
+++ b/redirects.php
@@ -0,0 +1,19 @@
+<?php
+$redirects = [
+  [
+    'pattern' => '/^\/?b\/^$/',
+    'redirect' => 'https://bugs.avm99963.com/'
+  ],
+  [
+    'pattern' => '/^\/?b\/([^\/]+)\/(\d+)$/',
+    'redirect' => 'https://bugs.avm99963.com/p/$1/issues/detail?id=$2'
+  ],
+  [
+    'pattern' => '/^\/?go\/([^\/]+)$/',
+    'redirect' => 'https://goto.corp.avm99963.com/$1'
+  ],
+  [
+    'pattern' => '/^\/?$/',
+    'redirect' => 'https://www.avm99963.com/'
+  ]
+];