I had my script set up on old.example.com/?paypal_notify=1. There were a few people who signed up to my membership plan while the site was on the old URL. I then moved my site to example.com (no more subdomain) and updated my IPN URL in the PayPal settings.
Unfortunately PayPal is still sending IPNs to the old URL for the members who signed up on the old URL. I tried to redirect the IPN with .htaccess from old.example.com
Redirect /?paypal_notify=1 http://example.com/?paypal_notify=1
This isn’t working – I think my redirect rule isn’t right. Can someone give me a pointer please? Thanks
Rewrite rules only match the path portion of a URL, which excludes the querystring.
When you want to match based on the querystring, you need to add a RewriteCond directive.
This should do what you want:
When you’re happy that it works as needed, replace the
R=302withR=301to make the redirect permanent.