From user-return-15194-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Mar 04 19:17:50 2011 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 46698 invoked from network); 4 Mar 2011 19:17:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Mar 2011 19:17:50 -0000 Received: (qmail 30701 invoked by uid 500); 4 Mar 2011 19:17:48 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 30669 invoked by uid 500); 4 Mar 2011 19:17: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 30657 invoked by uid 99); 4 Mar 2011 19:17:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 19:17:48 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of janez.stupar@gmail.com designates 209.85.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-iw0-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2011 19:17:42 +0000 Received: by iwn6 with SMTP id 6so2795745iwn.11 for ; Fri, 04 Mar 2011 11:17:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=TxVaQF+AC8dpjyGvxGqtNA1/D635J0Cbm9k2gf1+30Q=; b=tLftDbdX1V/B7lHoRtGEEJV0x6431oN0mEorOWupp71qgt3bZ2tHdfcdp9Qc7lJ3EY nvoe8tK3zTnuyvKqhUUYw7Mn/iMdPObJBLcRfbryPkp/XSB4LHl9Ff/mkh60TOr3Cl0r 65F5ukvTjvEJlVsjTx+uoyb3Fx6yyH/GWQdFs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Rr+k0J7aDCqTiIDu1KP3pEtTCc+O8HM6UjWIBczKt1kgt0LPN/lJK+u3kyMoYjoQ8e FKASsEscnkL1sn5SXr1xadd14CFTt1sj6lQsyutlEATerbYh0wdct/H4cFThIW46ycuJ 5ar7gVwjBu9/ZKAHrjEMx+NFH0zcMrzo8IKoA= MIME-Version: 1.0 Received: by 10.42.138.74 with SMTP id b10mr1024366icu.367.1299266241015; Fri, 04 Mar 2011 11:17:21 -0800 (PST) Received: by 10.231.11.141 with HTTP; Fri, 4 Mar 2011 11:17:20 -0800 (PST) In-Reply-To: References: Date: Fri, 4 Mar 2011 20:17:20 +0100 Message-ID: Subject: Re: Rewrite urls and views issue From: =?UTF-8?Q?Janez_=C5=A0tupar?= To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=90e6ba6138a2c3ae36049dacfe69 --90e6ba6138a2c3ae36049dacfe69 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Dmitry, I'm using the following rule: { "from": "view/:viewname/*", "to": "_view/:viewname/*" }, It works flawlessly, hope it helps. On Fri, Mar 4, 2011 at 9:40 AM, Dmitry Stropaloff wrote= : > 2011/3/4 Benoit Chesneau : > > On Fri, Mar 4, 2011 at 9:06 AM, Dmitry Stropaloff > wrote: > >> Hi, > >> > >> I'm trying to rewrite urls for my views (application will use CouchDB > >> virtual host): > >> > >> "from": "/views/*", > >> "to": "_view/*", > >> "method": "*", > >> "query": {} > >> > >> So, when I try to access db/_design/db/_rewrite/views/ > >> in log there is such info: rewrite to "/db/_design/db/_view" > >> > >> As expected, I get {"error":"method_not_allowed","reason":"Only > >> GET,POST,HEAD allowed"} > >> > >> But if I try to reach some view function - > db/_design/db/_rewrite/views/all > >> in log I get a very strange (for me) message: rewrite to > >> "/db/views/all?doc=3Dviews&attachment=3Dall" > > > > Never saw that. what exact url are you calling and the rewrite rules ? > > > > - beno=EEt > > > > I'm calling http://localhost:5984/db/_design/db/_rewrite/views/all - > url rewrite rules and view urls are from my app. "all" view is a > simple map function. Application was created with CouchApp, and view > stored in the views/all/map.js file. After pushing it to CouchDB this > view can be accessed via db/_design/db/_view/all url. > > Thanks, > Dmitry > --90e6ba6138a2c3ae36049dacfe69--