Forum Discussion
jony23
Nimbostratus
Aug 30, 2018replace path and query with "unknown" path
Hi,
I need some help please,
We have the next url https://www.host.com/abc/def/ghi?query=value&query1=value1 and the query could change depending on the request.
We have to do a 301 redirect to a ne...
Lee_Sutcliffe
Nacreous
Aug 30, 2018Hi, you say in your post that the redirect has to be total different? How do you mean? Different for each request?
The
[HTTP::path] command in an iRule will return everything up to the query.
So in your example: https://www.host.com/abc/def/ghi?query=value&query1=value1
[HTTP::path] would return /abc/def/ghi
So you can do a 301 redirect to https://www.host.com/abc/def/ghi using the following command
HTTP::redirect https://[HTTP::host][HTTP::path]
But I'm not sure if this is exactly what you're asking, please could you be more specific?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects