Welcome! Log In Create A New Profile

Advanced

Re: Redirect to custom landing pages based on http referer

Francis Daly
June 05, 2014 03:36AM
On Thu, Jun 05, 2014 at 03:15:26AM -0400, justink101 wrote:

Hi there,

> Is it possible using nginx to essentially look at the http referer header,
> and if its set to a specific value, and the page is index.html or /,
> redirect to a custom landing page.

Yes.

With a few other assumptions:

location = /index.html {
if ($http_referer ~* (www.)?amazon.com) {
return 301 /our-amazon-landing-page.html;
}
}

That doesn't scale much beyond one match; if you need that, use a "map".

f
--
Francis Daly francis@daoine.org

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

Redirect to custom landing pages based on http referer

justink101 June 05, 2014 03:15AM

Re: Redirect to custom landing pages based on http referer

Francis Daly June 05, 2014 03:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 311
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