Viewing 3 replies - 1 through 3 (of 3 total)
  • https://www.ads-software.com/plugins/redirection/
    USE regex
    Old url /\?result=(.*)&otherparamters=otherdata
    Regex alternative /\?result=([^&]*)&otherparamters=otherdata
    New url /page-for-result-$1

    USE query https://redirection.me/support/matching-a-url/

    Thread Starter accessamerica00

    (@accessamerica00)

    This is very helpful thanks. You’ve hit on exactly what I need. I understand enough REGEX to deal with basics, but not advanced. What you have above is very close to what I need. The only difference is that the “other parameters” will vary for each customer that purchases something. These parameters carry the same variables, but different data.

    I think what I need could simply be:

    Regex alternative /\?result=([^&]*)
    New url /page-for-result-$1

    Can I leave the remainder of the string blank? Or would I need to capture the rest of the URL parameters like this: (&*^) to universally match the rest of the parameters?

    So would this be correct?

    Regex alternative /\?result=([^&]*)(&*^)
    New url /page-for-result-$1

    I think we’re communicating on a number of different posts. This one (general), another post (specific to your plugin) 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:

    Thanks…
    Jeff…

    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.

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