AFAIK rewrites cannot currently be used to add a suffix to a matched variable in a URL path.
An alternative approach you could use is to put the content of file.html into a document with id "file" under a given key (named "content" or similar), create a show function [1] (calling it something like "render") that outputs the value of that key with content type "text/html" and then create a rewriter such as:
{
"from": "/:doc",
"to": "/_show/render/:doc",
"method": "GET",
"query": {
}
}
The complete design doc would look like this:
{
"_id": "_design/rewrite",
"shows": {
"render": "function(doc) { return { headers: { \"Content-Type\": \"text/html\"}, body: doc.content } }"
},
"rewrites": [
{
"query": {},
"method": "GET",
"to": "/_show/render/:doc",
"from": "/:doc"
}
]
}
And the corresponding doc:
{
"_id": "file",
"content": "<html>html content of doc goes here</html>"
}
I've shared an example which follows the above pattern [2].
[1] http://wiki.apache.org/couchdb/Formatting_with_Show_and_List
[2] https://mikewallace.cloudant.com/rewriter/_design/rewrite/_rewrite/file