Welcome! Log In Create A New Profile

Advanced

Rewrite ( Paypal IPN Handler)

Posted by extremecarver 
Rewrite ( Paypal IPN Handler)
December 09, 2018 10:23AM
Hi I would really need to have a rewrite to get paypal IPN calls at a different location - but I seem to be too stupid to write the correct rule:
Old URL www.velomap.org/?s2member_paypal_notify=1;
New URL www.velomap.org/?optimizemember_paypal_notify=1;

I tried the code below - but it's not rewriting/forwarding the IPN correctly. Would be really glad for some help here.

location / {
rewrite ^/?s2member_paypal_notify=1 ^/?optimizemember_paypal_notify=1 redirect;
try_files $uri $uri/ /index.php?$args;
}
Re: Rewrite ( Paypal IPN Handler)
December 09, 2018 11:39AM
I've also tried:
rewrite ^/?s2member_paypal_notify(.*)$ /?s2member_paypal_notify/?optimizemember_paypal_notify$1 last;

but that doesn't work either...
Re: Rewrite ( Paypal IPN Handler)
December 09, 2018 12:51PM
I got a bit further:

location / {
if ( $args ~* "s2member_paypal_notify" ) {
set $args "optimizemember_paypal_notify";
rewrite ^.*$ https://www.domain.org/ permanent;
}

try_files $uri $uri/ /index.php?$args;
}

This is working now for the IPN - however I noticed that if I enter e.g.

www.domain.org/?s2member_paypal_notify=1
the redirect goes to
www.domain.org/?optimizemember_paypal_notifiy
(missing the =1). So i think even though it is working - I'm missing a little bit here.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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