I need to redirect pages with specific URL appended characters to alternate pages. I realise the ideal way to do this is via the htaccess file, but for reasons too boring to go into, in this instance, that’s not possible.
A workaround I’ve found is to use @joeworkman Agent stack.
First I’ve added the Agent URL stack to the page. Using the rule “Match in url” and “show” options I’ve put the appended bit of text in the “URL match” box.
Then, in the drop zone I’ve put an Agent Redirect stack with the new URL in the “Redirect URL” box.
In effect, I’ve put an Agent stack inside and Agent stack.
It works, tested over a few browsers and it’s working as expected. But before I start to feel all big and clever, can anyone more familiaer with the stacks and how they work tell me if this is a super cool idea, or a really dumb one, for reasons that I can’t work out!
Hello, your solution is pretty creative, and it’s awesome that it’s working across different browsers. Using Agent like that is definitely a cool workaround for your scenario. That said, if you’re open to exploring another option, Joe Workman has a cool stack called Traffic Control that’s specifically designed for managing redirects.
It allows you to create and manage custom URL redirects without touching the .htaccess file. Plus, it has some extra features like setting expiration dates, times, or visit limits for redirects, making it a bit more flexible for advanced use cases.
Nesting Agent stacks should totally work. Its designed to support that behavior. Agent is 100% browser agnostic since all of the logic gets executed on the server.
As @Kent pointed out, Traffic Control is built for what seems to be the scenario that you are looking for. While it would be more efficient, the Agent setup that you did should work just fine too.