couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hendrik Jan van Meerveld <haa...@gmail.com>
Subject rewrite not working (am I a noob?)
Date Sat, 20 Nov 2010 10:39:32 GMT
Hi All,

I'm trying to get url-rewrite to work in couchdb.
My webpage is located at:

   http://localhost:5984/test/_design/main/_show/bones/en-bones-contact

I edited the "rewrites" field in the _design/main document (using futon) as
follows:

<code>
[
   {
       "from": "/xx/*",
       "to": "/_show/*"
   },
   {
       "from": "/_show/xx/*",
       "to": "/_show/bones/*"
   }
]
</code>

After saving this rewrite rule I was expecting that when I go to
   http://localhost:5984/test/_design/main/*xx*/bones/en-bones-contact<http://localhost:5984/test/_design/main/xx/bones/en-bones-contact>
or to
   http://localhost:5984/test/_design/main/_show/*xx*/en-bones-contact<http://localhost:5984/test/_design/main/_show/xx/en-bones-contact>
or to
   http://localhost:5984/test/_design/main/*xx/xx*/en-bones-contact<http://localhost:5984/test/_design/main/xx/xx/en-bones-contact>
this would show me the same page as the original.

But is doesn't.
I get errors like

"Document is missing attachment"

and

"missing function"


Am I doing anything wrong?
Should the field not be named "rewrites" but something like "_rewrite"?

Kind regards,
Hendrik Jan

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