Rewrite conversion

Edho Arief edho at myconan.net
Sat Jul 23 15:05:21 UTC 2011


On Sat, Jul 23, 2011 at 9:33 PM, Tseveendorj Ochirlantuu
<tseveendorj at gmail.com> wrote:
> Dear Igor,
> I just tested rewrite but one thing did not work. When I'm
> accessing http://www.xac.mn/index.php?do=/mytunes/view/song_40/module_popout/ this
> popup but I got
>
> 404 Not Found
>
> ________________________________
> nginx/0.7.65
> on the screen. Above url is working on Apache with rewrite.
> I do not know difference between these two rewrites.
> Apache
> RewriteRule ^(.*)$ /index.php?do=/$1 [L]
> Nginx location ~ ^/index.php(/.*)$ {           fastcgi_pass   backend;
>      include        fastcgi_params;            fastcgi_param
>  SCRIPT_FILENAME  /var/www/xac/index.php;
>            fastcgi_param  QUERY_STRING     do=$1;       }
>

the url http://www.xac.mn/index.php?do=/mytunes/view/song_40/module_popout/
is handled by this location block:

       location = /index.php {
           fastcgi_pass   ...
           include        fastcgi_params;
           fastcgi_param  SCRIPT_FILENAME  /path/to/files/index.php;
           fastcgi_param  QUERY_STRING     $args;
       }



More information about the nginx mailing list