Forum Discussion
Robert_47833
Aug 12, 2011Altostratus
how to change a string ,such as add a number after some letters
Hi,dear irule
I want to change the host name to another one
for example
www.cjj.com---->www2.cjj.com
cjj.com------>cjj2.com
*.cjj.com---->*2.cjj.com
domain [HTT...
Robert_47833
Aug 14, 2011Altostratus
Hi,all friends,I use irule below to achieve this:
switch -glob [string tolower [HTTP::host]] {
"srwd29.com" -
"www.srwd29.com" {
scan [HTTP::host] {%[^.]%s} domainfirst domainleft
set num 2
HTTP::redirect "http://$domainfirst$num$domainleft[HTTP::uri]"
}
I try to add "2" after $domainfirst( HTTP::redirect "http://$domainfirst2$domainleft[HTTP::uri]"),but it doesn't work ,that is why there is a num variable
Thank you for your great help
Recent Discussions
Related Content
- May 24, 2019Former Member
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