Help on rewrite rule

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

Posted at Nginx Forum:

On 17 October 2011 23:24, microchip [email protected] 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.

On 17 October 2011 23:35, Nginx U. [email protected] wrote:

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

Thanks :slight_smile:

and no, I’m not using Gallary2

Posted at Nginx Forum:

18.10.2011, 03:36, “Nginx U.” [email protected]:

On 17 October 2011 23:35, Nginx U. [email protected] wrote:

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

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

forget about rewrite with nginx:

location = /main.php {
fastcgi_pass …
fastcgi_param SCRIPT_NAME /index.php;
fastcgi_param SCRIPT_FILENAME /path/to/index.php;
}


br, Denis F. Latypoff.