Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 50854 invoked from network); 4 Jul 2009 22:12:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Jul 2009 22:12:39 -0000 Received: (qmail 6427 invoked by uid 500); 4 Jul 2009 22:12:49 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 6347 invoked by uid 500); 4 Jul 2009 22:12:49 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 6337 invoked by uid 99); 4 Jul 2009 22:12:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jul 2009 22:12:49 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=NORMAL_HTTP_TO_IP,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of paul.joseph.davis@gmail.com designates 209.85.210.204 as permitted sender) Received: from [209.85.210.204] (HELO mail-yx0-f204.google.com) (209.85.210.204) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 04 Jul 2009 22:12:37 +0000 Received: by yxe42 with SMTP id 42so1201459yxe.13 for ; Sat, 04 Jul 2009 15:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ZCYOVkwmejwZApdf3/VJJMmpkELvfR2DkXvBEksAz8c=; b=IWXsS/l4iUIN2hriRrOLXAFCsQsF4GjFpfUq1lm3mEpW6qtHjoHTRN22jpukYKFYAz A8NLrU5BiP1Vrzo8v6xTiCUW5Hoqyn0pcHVQwP8ueUfLSE2ozifHLDFMtKPMaKkD0AHC 5r+XVBki100X8FFYt/ucPaPhSwHQBy09hL8+c= 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:content-transfer-encoding; b=wchcSefN7oS2IgK2v9coGetBZsJ4mO3J3XtUZATTYHIneIytkYIAcUvPTOzsse31ss xt3ruTo3U8iFNHK8KbgYtv695oIY6wzidW8SgXVd7PBVzH5EgBmVId8+esleVgdDujyd 8u0jLHtLkxLrNmzT4GfFyOq9P3MBfYJQR3y1o= MIME-Version: 1.0 Received: by 10.100.166.7 with SMTP id o7mr5134078ane.90.1246745533386; Sat, 04 Jul 2009 15:12:13 -0700 (PDT) In-Reply-To: <20090704220857.GF17906@tumbolia.org> References: <879778450905061254s7bd5365etf82d85126471a24@mail.gmail.com> <879778450905071033n33151a5cs439e7912c9e21fbd@mail.gmail.com> <6EA12004-CCBE-47F2-BE78-4C3D6F72FD2F@jasondavies.com> <21614A96-E6D2-45A3-BF7F-9D1379D84782@jasondavies.com> <528EC433-F1B6-4F05-8B11-74A1FC7272F7@jasondavies.com> <20090704220857.GF17906@tumbolia.org> Date: Sat, 4 Jul 2009 18:12:13 -0400 Message-ID: Subject: Re: Rewriting URLs From: Paul Davis To: dev@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Jul 4, 2009 at 6:08 PM, Noah Slater wrote: > Hey Jason, > > On Sat, Jul 04, 2009 at 10:34:27PM +0100, Jason Davies wrote: >> The basic idea is you add a "rewrites": [...] member to your design doc. >> This will allow rewriting of any URLs with the prefix mydb/ >> _design/app/_rewrite. =A0The "rewrites" member is a list of rewrite rule= s >> of the form {match: ["foo/bar/"], rewrite:["_view/myview", >> {startkey: [""], endkey: ["", {}]}] > > This is great! > > Don't let me contribute stop-energy, but I am thinking that if we're goin= g to do > this, we might want to go the full way an implement this from the root UR= I of > the whole CouchDB server instead. > > Best, > > -- > Noah Slater, http://tumbolia.org/nslater > We've discussed where to push the URL rewriting previously. The biggest argument against a DB wide rewrite scheme is that _design/ documents could end up stomping on each other pretty easily. For reference in case other people are confused, the rewrite capabilities would be best used by putting a proxy in front of CouchDB that would rewrite all urls to the appropiate CouchDB path. Something like: Rewrite http://blog.mydomain.com/ to http://127.0.0.1:5984/my_blog_db/_design/sofar/_rewrite/ HTH, Paul Davis