Redirect Inoperative Link

During the affiliate approval process, we enter an “end” date. When that date comes to pass, the account notes “inoperative” below the person’s name in the Manage Affiliates section. If the account is inoperative, I do not want customers to be able to use that link. Is there a way to create a redirect based on that “inoperative” status? Currently, if the link is no longer active, it goes to a blank post. I’d like it to go to a specific page that I created stating, “This link is no longer active.” If you do not have specific redirect code to share, what is the database column “inoperative” is associated with?


Comments

3 responses to “Redirect Inoperative Link”

  1. Erica Thumma Avatar
    Erica Thumma

    If I use the link you suggested, I get the same page as if the person tries to use the link and the dates have ended. I believe it’s a 404 message – a white page w/ “No Results Found. The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.”

    Regardless, I still want people to be redirected to a specific page that I created if the affiliate is inoperative. We’re using this for fundraisers. I don’t want supporters potentially thinking they’re making a purchase that will benefit a fundraising group if the fundraising dates are over. Is there a way to do this?

    1. Hello,
      Unfortunately, this kind of functionality is not available out-of-the-box – it would require a certain amount of custom coding that is beyond the scope of the support forum. An example solution would include checking the HTTP request – if the parameter is valid (check the expiry date of the affiliate that has the ID from the request), then proceed as normal. Otherwise, use a call to wp_redirect() to redirect to your desired page.

      Cheers,
      Denitsa

  2. Hello there,
    Normally, when an affiliate expires, no referrals are recorded when their affiliate link is used. However, when an “inoperative” affiliate’s link is visited, it shouldn’t show a different page, so I’m a bit confused as to the blank page you mention that’s currently displayed.
    Would you perhaps describe a more detailed scenario so that I can understand the issue better? E.g., if you have a product page, let’s say example.com/product, and a user visits an inoperative affiliate’s link to it (say, example.com/product/?affiliates=INOPERATIVE_ID), what page is shown currently?

    Cheers,
    Denitsa

Share