2011年3月9日星期三

Re: How to redirect to a query

On 09.03.2011, at 12:51, sjark wrote:

> Same problem I get this error in chrome 310
> (net::ERR_TOO_MANY_REDIRECTS):
>
> [code]
> server {
> listen 80 default;
> server_name www.mysite.com;
> root /home/www/mysite;
> include standard.conf; #php-fpm settings
>
> location = / {
> rewrite ^ /?index=site&id=1? permanent;
> }
> }
> [/code]


location = / {
if ($arg_index = "") {
rewrite ^ /?index=site&id=1 permanent;
}

fastcgi_pass ...
... etc ...
}

or you may do without redirect at all:

location = / {
fastcgi_pass ...
fastcgi_param SCRIPT_FILENAME /path/to/index.php;
fastcgi_param QUERY_STRING index=site&id=1;
... etc ...
}


--
Igor Sysoev
http://sysoev.ru/en/


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

没有评论:

发表评论