Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#38038 closed defect (bug) (invalid)

Global $_GET parameter is broken in multisite subdirectory install

Reported by: arkimedia's profile arkimedia Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6.1
Component: Permalinks Keywords:
Focuses: multisite Cc:

Description

Hi,

Global $_GET parameter is not working correctly in multisite subdirectory install.

  1. If I add action to init which prints contents of the global $_GET parameter, it works when I'm in the front page of the primary site. For example http://example.org/q=test
  2. In the sub page (not sub site) like http://example.org/subpage/q=test I got empty array.

Many plugins like REST API are using $_GET parameters, for example to order results . All of these plugins are broken in multisite subdirectory install.

Change History (3)

#1 @SergeyBiryukov
7 years ago

  • Keywords reporter-feedback added

In the sub page (not sub site) like http://example.org/subpage/q=test I got empty array.

The correct URL would be http://example.org/subpage/?q=test (note the question mark before q).

Could you confirm that the issue still happens with the correct URL?

#2 @arkimedia
7 years ago

  • Keywords reporter-feedback removed
  • Resolution set to invalid
  • Status changed from new to closed

Yes, issue happens with the correct url, but I already found a root cause for this issue.

I was missing the $args parameter in my nginx.conf, which is required in subdirectory install.

After I changed

try_files $uri $uri/ /index.php;

to
try_files $uri $uri/ /index.php?$args;

everything is working correctly.

#3 @SergeyBiryukov
7 years ago

  • Milestone Awaiting Review deleted

Thanks for the follow-up, glad you got it working.

Note: See TracTickets for help on using tickets.