ZF-9879: Zend Controller Router Route's assemble method incorectly encodes slashes for use with url rewriting.


Calling Zend_Controller_Router_Route::assemble with $encode set to true and url rewriting enabled, if a parameter contains a slash, will return something like:


The resulting URL being invalid, it is rejected by Apache (and possibly other servers) before any rewriting attempt is even made. The supposed correct syntax is:


However this leads to q's value being "%2Fquery", and therefore would also need extra processing when reading parameters from URL.

See also: RFC2396


It is because an (odd?) Apache (2.x?) behavior. Here is the reason and the solution:…

Setting ``` in the Apache configuration is a solution. Be careful because this directive must be given in server config or virtual host context.

If this is considered a good solution, this bug could be a documentation lack.

See also this post:…

if i use

 it doesn't work

if i use 

it works, but i have then to ``` the 'url' parameter