Forum Discussion
Reorder URL
mj16othman It seems like this is the application inserting the text in the incorrect location of the URI if you have to reorder it. For simplicitys sake I recommend working on the application to insert the text in the appropriate location rather than doing this in an iRule as a bandaid. Now once you have explored that avenue of change and you are 100% that it cannot be done in the application then I would do it in an iRule. In order to configure this rule a bit easier, do you know the length that the string will always be or is this a string that is random in length but always starts with a ? and end with a #? Will this value only ever be integers from 0 t 9?
- mj16othmanFeb 26, 2023Altostratus
hi paulius
yes the string will always come after the ? The real length will always be 13 integers example tmx=1676539770970
- PauliusFeb 26, 2023MVP
mj16othman I think the following might do what you want but I'm not 100% so you might want to test this before putting it into production.
when HTTP_REQUEST priority 500 { if { [HTTP::uri] starts_with "/product/?tmz=" } { set PATH_TO_MOVE [string range [HTTP::uri] [expr {[string first "?tmz=" [HTTP::uri]] + 5}] 13] set REMOVE_CONTENT [string map [list "\?tmz=[0-9]{13}" "" ] [HTTP::uri]] HTTP::redirect http://[HTTP::host]${REMOVE_CONTENT}/?tmz=${PATH_TO_MOVE} } }
Recent Discussions
Related Content
* 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