Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache zend framework路由,带“0”/&引用;_Apache_.htaccess_Zend Framework2 - Fatal编程技术网

Apache zend framework路由,带“0”/&引用;

Apache zend framework路由,带“0”/&引用;,apache,.htaccess,zend-framework2,Apache,.htaccess,Zend Framework2,我在ZF2路由中有一个加密参数,其中包含“/”,例如: http://domain.com/request/$2y$14$OmovR9wA1TnBG2fxdKuU9ORYTPGChgfyesGVxilP74**/**2F2t8eJgbNF2 提交此请求时,URL将转到 http://domain.com/request/$2y$14$OmovR9wA1TnBG2fxdKuU9ORYTPGChgfyesGVxilP74**%**2F2t8eJgbNF2 这会导致一个问题,apache服务器会抛

我在ZF2路由中有一个加密参数,其中包含“/”,例如:

http://domain.com/request/$2y$14$OmovR9wA1TnBG2fxdKuU9ORYTPGChgfyesGVxilP74**/**2F2t8eJgbNF2
提交此请求时,URL将转到

http://domain.com/request/$2y$14$OmovR9wA1TnBG2fxdKuU9ORYTPGChgfyesGVxilP74**%**2F2t8eJgbNF2
这会导致一个问题,apache服务器会抛出一个错误,说找不到页面。是否有办法停止将参数字段中的“/”转换为“%”。我的.htaccess文件是

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*)$ - [E=BASE:%1] 
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
编辑

路线代码:

 'exampleroute' => array(
    'type'    => 'segment',
    'options' => array(

            'route'    => '/exampleroute/[:regexparameter]',
            'constraints' => array(

                     'regexparameter' => '[$.a-zA-z0-9_-]*',

            ),
            'defaults' => array(

                    '__NAMESPACE__' => 'Mynamespace\Controller',
                    'controller'    => 'exampleroute',
                    'action'        => 'example',
            ),
    ),
),

我必须在ZF2库的Zend\Mvc\Router\Http\Segment文件中添加“%2F”=>“/”。现在工作正常了

我是否正确理解您更改了核心文件?应该还有另一种方法,我相信您的路由配置只需要稍微调整一下;)我在zend的bug页面上看到一篇文章,说这是ZF1的一个问题。我只是在ZF2中应用了它。这有什么问题吗?我不会只是说“是”,因为这在很大程度上取决于实现。。。正如我所说,我认为您的路线配置是所有需要触摸的;)关于路由配置,你有什么建议吗?如果你能添加路由配置,我也许可以^^