Help on rewrite rule

Nginx User nginx at
Mon Oct 17 20:35:27 UTC 2011

On 17 October 2011 23:24, microchip <nginx-forum at> wrote:
> Hi,
> I'm fairly new when it comes to nginx and would like to basically
> rewrite the following:
> /main.php --> index.php
> Can someone please give me an example how to do this? Thanks

rewrite ^/main\.php(.*) index.php$1;

Hopefully we are not having a case of the XY Problem here as it looks
like you may be using Gallery2 ... in which case you should be looking
for Gallery2 rewrite rules.

More information about the nginx mailing list