drupal-with-nginx icon indicating copy to clipboard operation
drupal-with-nginx copied to clipboard

Why do we add q=$uri in fastcgi_drupal.conf

Open njt1982 opened this issue 9 years ago • 5 comments
trafficstars

I have been investigating a Redirect bug in Drupal 8 where, on redirect, the query string always gets "?q=node/123" tagged onto it, regardless of querystring preservation. See: https://github.com/md-systems/redirect/issues/70#issuecomment-192283378

It appears to be possibly related to this line: https://github.com/perusio/drupal-with-nginx/blob/D7/apps/drupal/fastcgi_drupal.conf#L4

When I removed the q= param from that, redirects began to function correctly and the rest of the site behaved normally (ie, URLs still worked).

What purpose does this line serve? Is it needed for D7? All my D7 sites locally still seem to work...

njt1982 avatar Mar 04 '16 13:03 njt1982

It appears this is needed for D6 compatibility; D7 and above should work without it.

longwave avatar Mar 04 '16 15:03 longwave

@njt1982 are you filing code with this issue?

stewsnooze avatar Mar 18 '16 15:03 stewsnooze

I noticed our Drupal 8 sites would append ?q=/ to the end of the top site URL. I removed the QUERY_STRING in fastcgi_drupal.conf and that fixed it.

How come there's no D8 branch in the repo?

tdm4 avatar Mar 17 '17 16:03 tdm4

@njt1982 @stewsnooze @longwave I just discovered something. Commenting out QUERY_STRING from fastcgi params breaks the site in some ways (like filtering in the /admin/content page), but if you set it like this (for Drupal 8), it works fine:

fastcgi_param QUERY_STRING $query_string;

Give it a try?

tdm4 avatar Mar 23 '17 10:03 tdm4

Works fine. Thanks

superfedya avatar Jan 20 '19 20:01 superfedya