Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F11722493
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/redirect/_documents.xml b/redirect/_documents.xml
new file mode 100644
index 0000000..d491342
--- /dev/null
+++ b/redirect/_documents.xml
@@ -0,0 +1,14 @@
+<!--
+ The following files are independant entry points able to be called directly, without index.php.
+
+ You can configure your web server to bypass Pluton for these. If you don't, Pluton will know not to print header/footer.
+-->
+<documents topic="redirect">
+ <document>
+ <article>index</article>
+ <title>Redirect</title>
+ <description>Redirect to the specified resource.</description>
+ <noheader />
+ <nofooter />
+ </document>
+</documents>
diff --git a/redirect/_targets.php b/redirect/_targets.php
new file mode 100644
index 0000000..b47b88d
--- /dev/null
+++ b/redirect/_targets.php
@@ -0,0 +1,6 @@
+<?php
+
+return [
+ "perdu" => "https://www.perdu.com/",
+ "visit-brussels" => "https://www.ticketing.brussels/fr/tickets?lastMinuteTickets=true&from=%%YYYY%%-%%MM%%-%%DD%%&to=%%YYYY%%-%%MM%%-%%DD%%",
+];
diff --git a/redirect/index.php b/redirect/index.php
new file mode 100644
index 0000000..66dd4a0
--- /dev/null
+++ b/redirect/index.php
@@ -0,0 +1,27 @@
+<?php
+
+function resolve_url (string $url) : string {
+ $search = [
+ "%%YYYY%%",
+ "%%MM%%",
+ "%%DD%%",
+ ];
+ $replace = [
+ date('Y'),
+ date('m'),
+ date('d'),
+ ];
+
+ return str_replace($search, $replace, $url);
+}
+
+$target = $_REQUEST["target"] ?? $_REQUEST["t"] ?? "";
+$targets = require('_targets.php');
+
+if ($target !== "" && array_key_exists($target, $targets)) {
+ $target_url = resolve_url($targets[$target]);
+ header('Location: '. $target_url);
+ exit;
+}
+
+header("HTTP/1.0 404 Not Found");
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Thu, Sep 18, 02:47 (21 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2989894
Default Alt Text
(1 KB)
Attached To
Mode
rTOOLS Nasqueron Tools
Attached
Detach File
Event Timeline
Log In to Comment