On Monday, November 11, 2013, Alexander Gabriel wrote:

> lol
> o.k., side issue is solved: the rewrites.json file is copied as an object
> into the design doc.
> thanks a lot.
>
> Remains the fact that the url is not rewritten.
> Any Ideas for that?
>
> Alex
>
>

i don't understand what you are trying to rewrite from to....

alias will redirect to the ddoc so each call on /index.html goes on the
index.html in the ddoc.

your rewrites her means you rewrite here means your trying to get
hostname/db/_designgn/dname . what is the url that you call in your tests?

>
>
>
> 2013/11/11 Stanley Iriele <siriele...@gmail.com <javascript:;>>
>
> > This gets me every time when I'm doing rewrites but a convenient way to
> > look it is...its a giant json object so....json extension
> > On Nov 10, 2013 4:22 PM, "Robert Newson" <rnew...@apache.org<javascript:;>>
> wrote:
> >
> > > rewrites.json not rewrites.js
> > >
> > > On 11 November 2013 00:03, Alexander Gabriel 
> > > <a...@barbalex.ch<javascript:;>>
> wrote:
> > > > Hi
> > > >
> > > > I have a couchapp on http://arteigenschaften.ch.
> > > > It's built with the original python couchapp tool.
> > > >
> > > > My goal:
> > > > Instead of
> > > > "http://arteigenschaften.ch/artendb/_design/artendb/index.html";
> > > > the url should look like:
> > > > "http://arteigenschaften.ch/index.html<
> > > http://arteigenschaften.ch/artendb/_design/artendb/index.html>
> > > > "
> > > >
> > > > In local.ini I have:
> > > > [vhosts]
> > > > arteigenschaften.ch:5984 = /artendb/_design/artendb/_rewrite
> > > > After uploading the local.ini file I do: "service couchdb restart" to
> > > apply
> > > > it.
> > > >
> > > > In my project root I have a file "rewrites.js" with this rule:
> > > > [
> > > > {
> > > > "method": "*",
> > > >  "from": "/artendb/_design/artendb",
> > > > "to": ""
> > > > }
> > > > ]
> > > >
> > > > This is copied into the design document by the couchapp tool.
> > > >
> > > > What am I missing to make it work?
> > > >
> > > >
> > > >
> > > > *****************
> > > > Side issue:
> > > >
> > > > What seems rather odd to me is that the rewrites rules are copied not
> > as
> > > > clean json but as a string:
> > > >
> > > > "rewrites": "[\r\n\t{\r\n\t\t\"method\": \"*\",\r\n\t\t\"from\":
> > > > \"/artendb/_design/artendb\",\r\n\t\t\"to\": \"\"\r\n\t}\r\n]"
> > > >
> > > >
> > > > I once got an error in the frontend saying that rewrites should be
> json
> > > not
> > > > text but weird enough this message has not reappeared.
> > > >
> > > > Anyway, I have changed the rewrites rule in the design document in
> > futon
> > > to:
> > > >
> > > > "rewrites": [
> > > >        {
> > > >            "method": "*",
> > > >            "from": "/artendb/_design/artendb",
> > > >            "to": ""
> > > >        }
> > > >    ],
> > > >
> > > >
> > > > This is nicer but - sigh - doesn't work either.
> > > >
> > > >
> > > > Thanks for help.
> > > >
> > > > Alex
> > >
> >
>

Reply via email to