Permalink
Browse files

redirect so it works for for both vhost and regular installs

  • Loading branch information...
1 parent 8bdca8d commit 037942ec674a2c84674ef0746021364aadd21314 @jchris jchris committed Aug 13, 2010
Showing with 6 additions and 3 deletions.
  1. +6 −3 shows/redirect.js
View
@@ -1,5 +1,8 @@
-function() {
+function(doc, req) {
var redirect = require("vendor/couchapp/lib/redirect");
- // todo make this work in both modes
- return redirect.permanent("/page/index");
+ // this would be the right way to do it (absolute URI)
+ // except req.path reflects the post-rewrite state
+ // return redirect.permanent([""].concat(req.path,"page","index").join("/"));
+ // for now, cheat and do a relative Location header
+ return redirect.permanent("page/index");
}

0 comments on commit 037942e

Please sign in to comment.