How to redirect internally?

Jonathan Matthews contact at
Fri Jul 27 12:22:29 UTC 2012

On 27 July 2012 13:12, Yash Ganthe <yashgt at> wrote:
> Hi,
> I have created a config so that a URL like
> is rewritten as
> This is what I see in Mozilla Firebug
> GET abc/electronics.html
> 301 Moved Permanently
> GET index.php/electronics.html?store=abc
> 200 OK
> What is annoying is that the browser now shows the rewritten URL and not the
> pretty URL. How can we ensure that the redirection happens only internally?

If you're rewriting from/to inside the same server{} stanza, you can
investigate using the "last" flag in the rewrite documentation:

I don't know how you can achieve this across different server{}s (with
the obvious proviso that you can have more than one server_name in a

Jonathan Matthews
Oxford, London, UK

More information about the nginx mailing list