Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author John Godley

    (@johnny5)

    If you mean can you redirect from one URL to another then yes, you can do that. More information can be found here:

    https://redirection.me/support/

    Thread Starter accessamerica00

    (@accessamerica00)

    Thanks John, since I posted last night I actually installed your plugin and tried to make it work. Sent you and email through you website/email. Apologies for redundancy… For the benefit of others, I’ll restate the question here and you can respond on this forum so others can see your answer:

    Redirection: Plugin: 4.2.3
    WordPress: 4.5.17 (single)
    PHP: 5.6.40
    Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
    JavaScript: https://www.carenetfamilyresources.org/wp-content/plugins/redirection/redirection.js
    REST API: https://www.carenetfamilyresources.org/wp-json/

    Hi John,

    I sent a query previously through you website. Subsequently installed the tool and looking to use it as I mentioned. Our use case is redirecting the return URL from a payment gateway within an iframe. The form posts and works fine except error messages are not user friendly. A valid success transaction will be https://www.carenetfamilyresources.org/error/?Result=0&Resp...(plus other parameters).

    An invalid/declined transaction will look like this:

    https://www.carenetfamilyresources.org/error/?Result=12&RespMSG=Decline:%20Invalid%20Trans%20-%20Invalid%20transaction%20(%20%20%20%20DECLINE%20%20%20%20%20)&AuthCode=05&PNRef=2881909&LastFour=0114&token=&ExpDate=0819&CardType=MASTERCARD&TotalAmt=1&InvNum=&HostedPageKey=4787&Name=Jeff%20Hunter&Time=4/27/2019%2010:33%20AM
    
    https://www.carenetfamilyresources.org/error/?Result=

    Would be the only common string between them. If the result=0, then we’d want to use the 301 redirect to display the thank you page. If the result = 12, then we want to display the …/denied page (which would tell them what to do to correct the transaction), any other result codes, display …/generalerror page.

    I was trying to setup a redirection to deal with the above and saw where I could specify a REGEX, but looks like we could only use a dropdown to deal with slash, etc (see screenshot).
    https://my.jetscreenshot.com/12412/20190427-jgsx-139kb.jpg

    Is it possible to setup a REGEX rule for the .htaccess file that would route ?Result=0 to the …/thankyou page, &Result12 to …/denied page? Everything else to …/generalerror page?

    Thanks in advance!

    Take care…
    Jeff…

    Thread Starter accessamerica00

    (@accessamerica00)

    One other clarification. I did look through your support site, but didn’t find anything specific to my question (i.e. using REGEX). AND – I didn’t see a place in the plugin where I could actually edit the REGEX. It only allowed me to select “ignore slash” or “ignore *”. I’ll need a more complete REGEX that parses the return code in the URL as I mentioned in my previous post.

    Again, apologies for the redundancies…

    And thanks in advance!

    Jeff…

    Thread Starter accessamerica00

    (@accessamerica00)

    I think we’re communicating on a number of different posts. This one (specific to your plugin), another post (general) and via your redirection.me site. Didn’t realize they were all connected until I’ve gotten further into this. Regardless, thanks for your great input and support. Really appreciate it.

    So now the question remains, how do I edit the REGEX with your plugin – which was the topic of another post here: https://www.ads-software.com/support/topic/redirect-to-page-based-on-url-parameter/

    Again, apologies for the redundancies.

    Jeff…

    Plugin Author John Godley

    (@johnny5)

    I am not following any other thread. I have replied by email.

    You can find information about regular expressions here:

    https://redirection.me/support/redirect-regular-expressions/

    This has nothing to do with ignoring slashes.

    Thread Starter accessamerica00

    (@accessamerica00)

    Thanks!

    Thread Starter accessamerica00

    (@accessamerica00)

    Thanks for your assistance. The final answer that works is to use this regex

    \?Result=(\d+).*

    This captures the first 2 numbers after Result= and puts it in $1, then the .* captures the rest of the string into #2. Only need that if you are doing a 301 redirect (have to capture the WHOLE string.

    Hi, I have nothing to do with the plugin, I just wanted to show the right way. Keep in mind that currently the plug-in does not allow alternatives (ie more than an old URL), so you can only perform a redirect and apply your target (the captured string). If result = integer is always followed by & propose a string /error/\?result=([^&]+)(&.+)But you must distinguish when the transition is true result = 0 and then/error/\?result=0(&.+) While the second rule may be /error/\?result=([^0]+)(&.+) when the transaction is false. or you create a php page that checks if the result exists and is true or if the result exists and is false .. (requires wordpress knowledge). or if the denied page appears even without using the plugin you simply need to apply when the transaction is true to redirect 301.

    Sorry for false /error/\?result=([^0&]+)(&.+) or /error/\?result=([1-9]+0*)(&.+)

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Redirect to page based on URL parameter’ is closed to new replies.