在重写路径中合并参数
Merge params in rewrite paths
我可以在重写处理程序或 VHOST 中将参数合并为一个吗?
例如:
{
"from": "/:db/:year/:doc",
"to": "../../../:db%2F:year/:doc",
"method": "GET"
}
我有一个名为 mydb/2015 的数据库。在 URL 中,斜线 '/' 将被 URL 编码为 %2F。我想要漂亮的 URL 和查询:
/mydb%2F2015/myDocId
改为
/mydb/2015/myDocId
DocId 可以包含应该 URL 编码的字符。
恐怕这是不允许的:
You can have / as part of the document ID but if you refer to a document in a URL you must always encode it as %2F. One special case is _design/ documents, those accept either / or %2F for the / after _design, although / is preferred and %2F is still needed for the rest of the DocID.