Forum Discussion
Kate_Kattar_107
Nimbostratus
Jul 22, 2008URL forwarding help
I have a fairly simple request but need some guidance regarding the best way to do it. My client is lauching a new website and would like to forwarding 30 other urls to this new url. For instance:
...
Andy_Herrman_22
Nimbostratus
Jul 30, 2008HTTP::host only gives you the hostname (host.co.uk). HTTP::uri will give you the path (/about.cfm), so try:
when HTTP_REQUEST {
switch -glob "[HTTP::host][HTTP::uri]" {
"host.co.uk/about.cfm" { HTTP::redirect "http://www.newhost.co.uk/page1 " }
"host.co.uk/audit.cfm" { HTTP::redirect "http://www.newhost.co.uk/aboutpage " }
}
}
You might run into case issues though (if someone goes to host.co.uk/About.cfm it wouldn't be caught). In which case you'd want to do something like this:
when HTTP_REQUEST {
switch -glob [string tolower "[HTTP::host][HTTP::uri]"] {
"host.co.uk/about.cfm" { HTTP::redirect "http://www.newhost.co.uk/page1 " }
"host.co.uk/audit.cfm" { HTTP::redirect "http://www.newhost.co.uk/aboutpage " }
}
}
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