ama
December 5, 2024, 9:31pm
1
What is the name of the domain?
Hosting solutions, backed by a 99.9% uptime, complimentary SSL security, effortless WordPress installation, and a one-year free domain.
What is the issue you’re encountering
How to transform URL to add query string
What steps have you taken to resolve the issue?
I want to transform URLs as follows:
Incoming: mydomain.com/*/page/abc123
Transformed: mydomain.com/${1}/page-handler/?id=abc123
I’ve tried to do this under Rules–>Transform Rules by putting the Incoming string into Target Path and the Transformed string into Rewrite To, but this doesn’t work.
How do I make this transformation work?
ncano
December 6, 2024, 6:32pm
2
Path and query string are two separate inputs in Transform Rules, so you will need to do something like this:
If incoming requests match…
Then…
Set Rewrite parameters
Path > Rewrite to… > Dynamic: wildcard_replace(http.request.uri.path, "/*/page/*", "/${1}/page-handler/")
Query > Rewrite to… > Dynamic: wildcard_replace(http.request.uri.path, "/*/page/*", "id=${2}")