URL Rewriter: Split a query parameter value using Advanced Rule or XML Rule

I’m trying to configure a URL rewrite rule in Bloomreach Experience Manager that redirects based on a query parameter value. Here’s my use case:

From URL:

https://www.example.com/microsite/advice/?advisorId=john.doe@domain.com

To URL:
https://www.exampleadvisors.com/john.doe

So I need to extract the part before @domain.com from the advisorId query parameter and use it in the rewritten URL.

below is the rule I’m trying to use:

<rule>
    <condition type="header" operator="equal" name="host" next="and">www.qa.example.com</condition>
    <condition type="query-string" operator="matches" name="advisorId">([a-zA-Z0-9\.]+)@domain\.com</condition>
    <from>^/microsite/advice[/]?$</from>
    <to type="temporary-redirect" qsappend="false">https://www.exampleadvisors.com/$1/</to>
</rule>

The rule isn’t working as expected. Can someone hep me resolve this one?

Hi @Vineetha.gourishetty ,

Could you please use %1 is used instead of $1 because we suspect that your matched capture group (([a-zA-Z0-9\.]+)) comes from the second <condition> rather than the <from> rule.

Please find more details here :

Thanks and Regards,
Bloomreach Support

Hi @Rajesh_Sailada,

Thanks for the suggestion! I tried using %1 instead of $1, assuming the capture group comes from , but the rule still isn’t working.
Also, It seems the pattern isn’t matching or triggering the redirect at all.
I’ll keep digging—if you have any examples or tips from similar cases, I’d really appreciate it!

Regards,
Vineetha.

Thanks @Rajesh_Sailada — found the solution! Appreciate your help.
— Vineetha