Forum Discussion
OLD URL TO NEW URL REDIRECT USING DIFFERENT PORT.
Hi, I am a freshman iruler and I am trying to redirect from one url to a separate url and in doing this going from http to https but the port used will NOT be 443, but in this case it will be something different such as 9999. So to put it in a practical perspective. I have this site www.oldsite.com, when users type this site I want them to get redirected to www.newsite.com, and in getting redirect it should be from http to https using port 9999 instead of the usual 443.
Below is what I have, but I think I am missing something, because I am getting an error.
HTTP::header replace Host "[HTTP::host]:9999" if { [string tolower [HTTP::host]] equals "www.oldsite.com" } { HTTP::redirect "https://www.newsite.com" } }
NOTE: I know this should be possible. I think I am just missing something I am not recognizing.
3 Replies
- Cory_50405
Noctilucent
Try this one:
when HTTP_REQUEST { HTTP::redirect https://[getfield [HTTP::host] ":" 1]:9999[HTTP::uri] } - Shlairshe_84486
Nimbostratus
quite short , will try it, and let you know, just a quick question, the 1]:9999, is it missing another brace.
Rgds,
Steven.
- Cory_50405
Noctilucent
The syntax should be correct. You'd apply it to your virtual server that's listening on HTTP (presumably port 80) and it'll redirect to 9999 on HTTPS.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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