Rewrite rule for all requests from a user-agent only works on root domain

We’re trying to rewrite all URL requests from 1 specific user-agent so that they append “?campaign=123”.

We set a rule in Transform Rules > URL Rewrite that should do this.

But it seems to only work on the root domain. It doesn’t work on any other page.

In other words, we want ?campaign=123 appended as…

https://mysite.com?campaign=123 >> this works
https://mysite.com/page-1?campaign=123 >> this doesn’t work
https://mysite.com/blog/post-1?campaign=123 >> this doesn’t work

Here’s a screenshot of our settings.

What do we fix?
Screen Shot 2022-01-06 at 2.03.19 PM

Do you want it to be appended or set? Because right now you are doing the latter.

Also, you should not change your path, right now all requests are going to the root directory. That’s why you believe it does not work.

Apart from that it looks all right.

Thanks.

I’ve updated the Rewrite rule and pasted the new settings above.

Now no page is getting appended with ?campaign123.

I still must be doing something wrong.

Post a screenshot of what you configured and you didn’t answer my question :wink:

Thanks for the reply.

Here are the current settings that don’t seem to work.

How do I translate your advice into changes to these settings? The settings seem to enact your recommendations, though I may be wrong.

These are the correct settings. I just ran this very rule and it worked exactly as expected.

How do you establish that the parameter does not get set?

Also, you still didn’t address my question :wink:

I still have it set up on sitemeer.com. If you change your user agent to include happynewyear and request the site you should get a different output. I’ll leave that change online for about one more hour if you want to check it.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.