Forum Discussion
mj16othman
Feb 26, 2023Altostratus
Reorder URL
Dears i need help !!!!!!! I have a Url lets say https://abc.com/product/#/motor/lead when clients access this url , it assigns a "tmx" in the middle of the url. What i want is when the clients...
mj16othman
Altostratus
hi paulius
yes the string will always come after the ? The real length will always be 13 integers example tmx=1676539770970
Paulius
Feb 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
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