Forum Discussion
http redirect issue with $ character
Hi All
I have the following redirect setup and it seems to work aprt form when the $ character is inserted into the rule.
when HTTP_REQUEST {
if { [HTTP::host] equals "www.thiswebsite.com" and [HTTP::uri] starts_with "/t/$1" } {
HTTP::redirect "http://www.thiswebsite2.com/www.thiswebsite.com/t/$1"
}
}
The problem however is that the virtual server responds with a receive failure. There is something about the $ that the F5 VS doesnt like.
Any pointers would be appreciated
The $1 is being treated as a variable. Escape the dollar-sign in both locations with a "\" to match "$1":
/t/\$1
- shaggy_121467Cumulonimbus
The $1 is being treated as a variable. Escape the dollar-sign in both locations with a "\" to match "$1":
/t/\$1
- david0512_20548NimbostratusThanks Shaggy....This seems to have done the trick
- shaggyNimbostratus
The $1 is being treated as a variable. Escape the dollar-sign in both locations with a "\" to match "$1":
/t/\$1
- david0512_20548NimbostratusThanks Shaggy....This seems to have done the trick
- afedden_1985Cirrus
are you just wanting to change the host destination? this might work if you are keeping the URI the same . when HTTP_REQUEST { if { [string tolower [HTTP::host]] equals "bigdog.some.domain" } { HTTP::respond 301 Location "http://www.Lildog.com[HTTP::uri]" } }
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