couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ido Ran <ido....@gmail.com>
Subject VHosts and Rewrite rules
Date Mon, 18 Oct 2010 16:48:20 GMT
Hi,
I've found these two articles about rewrite urls and virtual host in
CouchDB:
[1]
http://mail-archives.apache.org/mod_mbox/couchdb-dev/201001.mbox/%3Cb7cd8ed11001241100r259306d2g1f00981051791cad@mail.gmail.com%3E
[2]
http://blog.couchone.com/post/443028592/whats-new-in-apache-couchdb-0-11-part-one-nice-urls

But yet I didn't manage to make it work on my localhost CouchDB instance.

I have a database called "todos" with one design-document called "app" and a
view in the ddoc called allTasks.
Currently to get all the tasks in the database the url is
http://localhost:5984/todos/_design/app/_view/allTasks
I would like to have the url http://localhost:5984/todos/tasks rewritten to
the previous url.

I add rewrites value to my ddoc and add the following rule:
   {
       "from": "/tasks",
       "to": "_view/allTasks",
       "method": "GET"
   }

Now when I ask for http://localhost:5984/todos/_design/app/_rewrite/tasks it
rewrite the url to _design/app/_view/allTasks so that one works.

I've add vhosts section to my local.ini file and there I'm not sure how to
redirect http://localhost:5984/todos/* to
http://localhost:5984/todos/_design/app/_rewrite

If someone can please help it will be great.

Thank you,
Ido

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message