How to redirect to a query

Francis Daly francis at daoine.org
Wed Mar 9 14:28:49 MSK 2011


On Wed, Mar 09, 2011 at 04:51:31AM -0500, sjark wrote:

Hi there,

> Same problem I get this error in chrome 310
> (net::ERR_TOO_MANY_REDIRECTS): 

>     location = / {
>       rewrite ^ /?index=site&id=1? permanent;

That's not the config that was suggested. The "?" immediately after the
"/" makes all the difference.

The original question was about www.mysite.com redirecting to
www.mysite.com/site.php?site=1 (for which the suggested config should
work).

This question is about www.mysite.com redirecting to
www.mysite.com/?index=site&id=1 (for which, as Igor showed, you must
check the "args" of the query string).

And the next question is about one.mysite.com and two.mysite.com each
redirecting to similar urls with different query strings.

I'll reply to that one separately.

But different problems get different solutions. And if you don't know
whether the problems are different (and the docs give no hint), then it's
good to ask about the problem you care about rather than a simplified
version that is possibly significantly different.

Cheers!

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list