Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8CB7010358 for ; Mon, 11 Nov 2013 00:22:49 +0000 (UTC) Received: (qmail 111 invoked by uid 500); 11 Nov 2013 00:22:48 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 99977 invoked by uid 500); 11 Nov 2013 00:22:48 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 99969 invoked by uid 99); 11 Nov 2013 00:22:48 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Nov 2013 00:22:48 +0000 Received: from localhost (HELO mail-la0-f43.google.com) (127.0.0.1) (smtp-auth username rnewson, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Nov 2013 00:22:47 +0000 Received: by mail-la0-f43.google.com with SMTP id n7so2375924lam.2 for ; Sun, 10 Nov 2013 16:22:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=15p+HI7kbILXoq5g2c028quDZ61OICqUkhashiTQkkY=; b=a6ypjygIRjWaCFdBY5zF7E8/s0+pjKYulf0Y8p04qaIrvQAbH8lL0TlLd2cQcQaK0f wOFL3GN/vHZSxnR5G1W56gB/zh+OrjEi3j1hZse5Ax4EykZKCWN/J7vBbzZSXTlDLNnN hnmH0QIyx8rXM7HgHCAsFjnJJjQo7WBKjwvIzk/P2tYm0QNvqtA7ld2ColMtsDBY0sDI p6ohF1wpLczfPM9dC5Hs3wxHhV47JocpIh5AUJ0TjSRScaOsnp6fJRI6G1iYmQdOpZPj kQ/3kIBv03cSzzr3SQIbmi+vRYADS/H/8D0+OKLKlODfyUZgY0ijRolQ2/38F4T2Zz33 v2GQ== MIME-Version: 1.0 X-Received: by 10.112.234.168 with SMTP id uf8mr1487880lbc.35.1384129365850; Sun, 10 Nov 2013 16:22:45 -0800 (PST) Received: by 10.112.67.12 with HTTP; Sun, 10 Nov 2013 16:22:45 -0800 (PST) In-Reply-To: References: Date: Mon, 11 Nov 2013 00:22:45 +0000 Message-ID: Subject: Re: rewrites not working From: Robert Newson To: "user@couchdb.apache.org" Content-Type: text/plain; charset=ISO-8859-1 rewrites.json not rewrites.js On 11 November 2013 00:03, Alexander Gabriel 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 > " > > 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