Loop through a view and put request content in a file
for row in db.view('ddoc/view'):
slug = row.value['slug']
r = requests.get(_url(slug))
with file('%s/%s.html'%(static_dir,slug),'w') as f:
f.write(r.content) # r.content.encode('utf-8')_ http://pypi.python.org/pypi/requests
Apache rewrites
RewriteRule ^/a/b/(.*)\.html$ /a/b/$1 [N]
RewriteRule ^/a/(.*)? http://127.0.0.1:5984/{db}/_design/{ddoc}/_rewrite/$1 [QSA,P]