Thank you Janes - it works. I think my issue happened due to conflicts between some rewrite rules.
All the best, Dmitry 2011/3/4 Janez Štupar <[email protected]>: > 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 <[email protected]>wrote: > >> 2011/3/4 Benoit Chesneau <[email protected]>: >> > On Fri, Mar 4, 2011 at 9:06 AM, Dmitry Stropaloff <[email protected]> >> 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=views&attachment=all" >> > >> > Never saw that. what exact url are you calling and the rewrite rules ? >> > >> > - benoît >> > >> >> 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 >> >
