Welcome! Log In Create A New Profile

Advanced

Re: How to redirect internally?

Jonathan Matthews
July 27, 2012 08:24AM
On 27 July 2012 13:12, Yash Ganthe <yashgt@gmail.com> wrote:
> Hi,
>
> I have created a config so that a URL like
> www.mysite.com/abc/electronics.html is rewritten as
> www.mysite.com/index.php/electronics.html?store=abc.
>
> 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:
http://nginx.org/r/rewrite

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
server{}).

HTH,
Jonathan
--
Jonathan Matthews
Oxford, London, UK
http://www.jpluscplusm.com/contact.html

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

How to redirect internally?

Yash Ganthe July 27, 2012 08:14AM

Re: How to redirect internally?

Jonathan Matthews July 27, 2012 08:24AM

Re: How to redirect internally?

Francis Daly July 27, 2012 08:34AM

Re: How to redirect internally?

Yash Ganthe July 29, 2012 12:04AM

Re: How to redirect internally?

Jonathan Matthews July 29, 2012 06:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 177
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready