rewrite question

Francis Daly francis at
Mon Jun 11 15:05:35 UTC 2018

On Thu, Jun 07, 2018 at 07:57:43PM -0400, shiz wrote:

Hi there,

> Recently, Google has started spidering my website and in addition to normal
> pages, appended "&amp" to all urls, even the pages excluded by robots.txt
> e.g.  page.php?page=aaa -> page.php?page=aaa&amp
> Any idea how to redirect/rewrite this?

Untested, but:

  if ($args ~ "&amp$") { return 400; }

should handle all requests that end in the four characters you report.

You may prefer a different response code.

Good luck with it,

Francis Daly        francis at

More information about the nginx mailing list