perusio / drupal-with-nginx

Running Drupal using nginx: an idiosyncratically crafted bleeding edge configuration.
855 stars 246 forks source link

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

Open njt1982 opened 8 years ago

njt1982 commented 8 years ago

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...

longwave commented 8 years ago

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

stewsnooze commented 8 years ago

@njt1982 are you filing code with this issue?

tdm4 commented 7 years ago

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 commented 7 years ago

@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?

superfedya commented 5 years ago

Works fine. Thanks