Did this ring anyone's bell ? -- Clément
On 17 fév, 18:41, Clément Hallet <[email protected]> wrote: > Well, this one is a bit tricky since it causes no problem in classic > use cases. I'll try to make it simple : > > In the .htaccess file [1], there is : RewriteRule ^(.*)$ index.php?/$1 > [QSA,L] > > In the CakeRequest file [2], while fetching data about the request, > the first source is $_SERVER['PATH_INFO'] then it fallbacks to > $_SERVER['REQUEST_URI'] > > What can be concluded through that : > - with this basic rewrite rules, there is no PathInfo, instead the > user request path part is rewritten as the query part of the internal > request > - while fallbaking to $_SERVER['REQUEST_URI'], the user requested is > taken into account instead of the internal request, leading to not > handling the Rewrite Rule (seems to work because of the REQUEST_URI). > > I would suggest to change one of the three following things : > - using "RewriteRule ^(.*)$ index.php" as the Rewrite Rule, if we > want to priority consider the user request > - using "RewriteRule ^(.*)$ index.php/$1" as the Rewrite Rule, if we > want to priority consider the internal request (need AcceptPathInfo to > be handled by the server [3]). It could be particulary useful when > advanced rewriting rules are used. > - using "array_pop(array_keys($_GET))" (or something equivalent) as > the primary path value in the CakeRequest::_url function > > [1] :https://github.com/cakephp/cakephp/blob/master/app/webroot/.htaccess#L5 > [2] :https://github.com/cakephp/cakephp/blob/master/lib/Cake/Network/CakeR... > [3] :http://httpd.apache.org/docs/2.0/mod/core.html#acceptpathinfo -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php
