rewrite rule: MediaWiki to static site

petecooper nginx-forum at
Mon Aug 20 10:09:10 UTC 2018

I'm diverting traffic from an retired MediaWiki site to an active static
site. I'm somewhat confused with the process of `rewrite`-ing old URLs with
a query string to standard URLs *without* a query string on the static site.
For clarity, I do not need or want query strings on the new site.

Retired URLs examples:

New URLs examples:

All the retired URLs are attached to `/wiki/index.php` with a single query

There is no direct correlation between the old URLs and the new ones, and I
have a before-and-after list of URLs to put into a 200+ entry `rewrite`

My question is two-fold:

1) Is it better (objectively) to have all the rewrite rules inside a
`location` referring to `/wiki/index.php` since the only non-Mediawiki URL
on the retired site is `/`?
2) How can I best build the `rewrite` list without using `if` or nested

I am grateful for your time and attention, and I would very much appreciate
an example rewrite rule and/or some reading recommendations for `rewrite`
with query strings.

Thank you.

Posted at Nginx Forum:,280913,280913#msg-280913

More information about the nginx mailing list