changeset 35:be526f103e9c

~ first set of redirects
author Alexandre Bertails <bertails@w3.org>
date Wed, 10 Aug 2011 18:55:37 -0400
parents 27ea2c63a0ff
children 9d5d92029b3c
files src/main/scala/Main.scala
diffstat 1 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/scala/Main.scala	Wed Aug 10 14:30:52 2011 +0200
+++ b/src/main/scala/Main.scala	Wed Aug 10 18:55:37 2011 -0400
@@ -179,7 +179,27 @@
       }
     }
 
-    unfiltered.jetty.Http.local(2719).filter(pubrules).filter(trdoc2rdf).filter(echo).run()
+    /**
+     * https://cvs.w3.org/Team/WWW/2005/07/.htaccess
+     * https://cvs.w3.org/Team/WWW/2005/09/checker/pubrules-parser.php
+     * https://cvs.w3.org/Team/WWW/2005/09/checker/pubrules-form.php3
+     */
+    val redirects = unfiltered.filter.Planify {
+//      case Path("/2005/07/pubrules-checker") & QueryString(queryString) => Redirect("/2005/09/checker/pubrules-form"+queryString)
+        case Path("/2005/09/checker/pubrules-parser") & QueryString(queryString) & Params(params) => {
+          lazy val check = params("check").headOption
+          lazy val uri = params("check").headOption
+          lazy val filter = params("filter").headOption
+          if (check.isDefined && uri.isDefined)
+            Redirect("/2005/09/checker/pubrules-form" + queryString)
+          else if (filter.isDefined)
+            Redirect("http://www.w3.org/2005/07/pubrules?" + queryString + "#docreqs")
+          else
+            InternalServerError ~> ResponseString("You have reached this page due to an error...")
+        }
+    }
+
+    unfiltered.jetty.Http.local(2719).filter(pubrules).filter(trdoc2rdf).filter(echo).filter(redirects).run()
 
 
   }
Set up and maintained by W3C Systems Team, please report bugs to sysreq@w3.org.

W3C would like to thank Microsoft who donated the server that allows us to run this service.