InnerWorld
InnerWorld

Reputation: 595

Merge params in rewrite paths

Can I merge params as one in rewrite handlers or VHOST ?

In example:

{
       "from": "/:db/:year/:doc",
       "to": "../../../:db%2F:year/:doc",
       "method": "GET"

   }

I have database named mydb/2015. In URL slash '/' will be URL-encoded to %2F. I would like to have pretty URL and query:

/mydb%2F2015/myDocId

change to

/mydb/2015/myDocId

DocId could have chars which should be URL-encoded.

Upvotes: 0

Views: 27

Answers (1)

Anthony
Anthony

Reputation: 12736

I'm afraid this is not permitted:

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.

Prooflink

Upvotes: 1

Related Questions