1. Luke Plant
  2. haskellblog

Commits

Luke Plant  committed 312884a

Implemented redirect page for blog.php

  • Participants
  • Parent commits 70d6b3e
  • Branches default

Comments (0)

Files changed (1)

File src/blog.php.tpl

View file
 
 $$catMap = ${categoryIdsToUrls};
 
+header ('HTTP/1.1 301 Moved Permanently');
 
+$$id = $$_GET['id'];
+$$cat = $$_GET['cat'];
+
+if (!empty($$id)) {
+   header('Location: ' . $$postMap[$$id]);
+   exit();
+}
+
+if (!empty($$cat)) {
+   header('Location: ' . $$catMap[$$cat]);
+   exit();
+}
+
+header('Location: /blog/')
 ?>