[wp-trac] [WordPress Trac] #20008: Search Results Paging Doesn't Work on Lighttp 404 Handler

WordPress Trac noreply at wordpress.org
Wed Aug 21 16:49:31 UTC 2013


#20008: Search Results Paging Doesn't Work on Lighttp 404 Handler
--------------------------+------------------------
 Reporter:  anniyan07     |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  General       |     Version:  3.3.1
 Severity:  major         |  Resolution:  duplicate
 Keywords:                |
--------------------------+------------------------
Changes (by SergeyBiryukov):

 * milestone:  Awaiting Review =>


Old description:

> Quote from http://core.trac.wordpress.org/ticket/11723
>
> I'm running Wordpress on lighttpd, using server.error-handler-404 =
> "index.php", all the pretty permalinks work perfectly. However, when
> doing a search, i only get the first results page, that is
> mysite.com/?s=query works but '''mysite.com/page/2/?s=query''' doesn't (i
> get shown the home page saying it's on page two of it). Paging on
> categories, archives and tags works as expected too.
>
> I believe this is a Wordpress error, as the variables are being correctly
> passed to the script. Strangely
> '''mysite.com/index.php/page/2/?s=query''' or
> '''mysite.com/?s=query&page=2 works''' as expected, i have tried
> exploring the code but i don't really know about the internals of the
> wordpress core.
>
> I tried the solution but not working for me.
>
> {{{
> function wp_fix_lighttpd() { //checks if URI has parameter and sets
> globals
>         if (isset($_GET) && isset($_SERVER['QUERY_STRING'])) return;
>         $donga = explode('?', $_SERVER['REQUEST_URI'], 2);
>         if (count($donga) > 1) {
>                 $_SERVER['QUERY_STRING'] = $donga[1];
>                 parse_str($donga[1], $_GET);
>                 $_REQUEST = array_merge( (array)$_GET, (array)$_REQUEST);
>         }
> }
> }}}
>
> I hope anyone can help me fix this. Thanks.

New description:

 Quote from #11723

 > I'm running Wordpress on lighttpd, using server.error-handler-404 =
 "index.php", all the pretty permalinks work perfectly. However, when doing
 a search, i only get the first results page, that is mysite.com/?s=query
 works but '''mysite.com/page/2/?s=query''' doesn't (i get shown the home
 page saying it's on page two of it). Paging on categories, archives and
 tags works as expected too.
 >
 > I believe this is a Wordpress error, as the variables are being
 correctly passed to the script. Strangely
 '''mysite.com/index.php/page/2/?s=query''' or
 '''mysite.com/?s=query&page=2 works''' as expected, i have tried exploring
 the code but i don't really know about the internals of the wordpress
 core.

 I tried the solution but not working for me.

 {{{
 function wp_fix_lighttpd() { //checks if URI has parameter and sets
 globals
         if (isset($_GET) && isset($_SERVER['QUERY_STRING'])) return;
         $donga = explode('?', $_SERVER['REQUEST_URI'], 2);
         if (count($donga) > 1) {
                 $_SERVER['QUERY_STRING'] = $donga[1];
                 parse_str($donga[1], $_GET);
                 $_REQUEST = array_merge( (array)$_GET, (array)$_REQUEST);
         }
 }
 }}}

 I hope anyone can help me fix this. Thanks.

--

--
Ticket URL: <http://core.trac.wordpress.org/ticket/20008#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list