incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: rewrite not working (am I a noob?)
Date Sat, 20 Nov 2010 12:10:28 GMT
Hi Hendrik,

the base URL for rewrites is always

  /database/_design/app/_rewrites

so `from: /xx/*`, `to: /_show/*` will rewrite

  /database/_design/app/_rewrites/xx/foobarbaz

to

  /database/_design/app/_show/foobarbaz

I hope that helps.

Cheers
Jan
-- 


On 20 Nov 2010, at 11:39, Hendrik Jan van Meerveld wrote:

> 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
View raw message