1
0
Prechádzať zdrojové kódy

Add Redirector instructions

Sunny 2 rokov pred
rodič
commit
cca542d1cd
1 zmenil súbory, kde vykonal 16 pridanie a 0 odobranie
  1. 16 0
      pages/index.php

+ 16 - 0
pages/index.php

@@ -1,5 +1,13 @@
 <?php include "../elements/header.php" ?>
 
+<?php
+  $scheme = $_SERVER["REQUEST_SCHEME"];
+  $host = $_SERVER["HTTP_HOST"];
+  $uri = $_SERVER["REQUEST_URI"];
+
+  $url = $scheme . "://" . $host . str_replace("/index.php", "/", $uri);
+?>
+
 <h1>Tent</h1>
 <p>
   Tent is a simple alternative front-end for Bandcamp.
@@ -26,6 +34,14 @@
   <li>manage your account or collection.</li>
 </ul>
 
+<h2>How do I set up Redirector?</h2>
+<p>To set up a redirection extension, create the following rules:</p>
+<ul>
+  <li><code>https://bandcamp.com/search?q=$1</code> → <code><?= $url ?>search.php?query=$1</code></li>
+  <li><code>https://$1.bandcamp.com/</code> → <code><?= $url ?>artist.php?name=$1</code></li>
+  <li><code>https://f4.bcbits.com/img/$1</code> → <code><?= $url ?>image.php?file=$1</code></li>
+</ul>
+
 <h2>Is Tent open-source?</h2>
 <p>
   Tent is still in early development.