Welcome! Log In Create A New Profile

Advanced

redirect only every 2nd or 3rd request

September 02, 2014 04:59AM
I'm trying to set up a rule which is going to redirect only every second or third request only if the URL contains a specific string.
I did already the redirect based on a string in the URL but I can't find how to redirect only every second on third request:

if ($request_uri ~ .*.WHATEVER_STRING.*) {
if (this is the 2nd request than) {
rewrite ^/(.*) WHATEVER_URL;
}
}
Subject Author Posted

redirect only every 2nd or 3rd request

laszlo September 02, 2014 04:59AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 71
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready