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: http://www.webmasterworld.com/apache/3279075.htm RFC2396


It is because an (odd?) Apache (2.x?) behavior. Here is the reason and the solution: http://httpd.apache.org/docs/2.2/…

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: http://zend-framework-community.634137.n4.nabble.com/…

if i use

 it doesn't work

if i use 

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