Forum Discussion
Roland_Hansen_1
Nimbostratus
Apr 16, 2015Need an iRule to append domain.com on an HTTPS request
I have an iRule set up to check my http requests
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
*.domain.com {
HTTP::redirect https://[HTTP::host][HTTP::uri]
} default {...
Michael_Jenkins
Cirrostratus
Apr 16, 2015Are the requests coming from the internet or the intranet? The problem I would see with this idea from the internet is that you have to have a fully qualified domain to being with (e.g. example.com) so you'd be trying to redirect to
example.com.domain.com which I'm guessing isn't what you want. So that would probably not work right.
Internally, if you're just trying to redirect from a simple hostname to a fully qualified hostname (e.g.
https://example to https://example.domain.com), you would need to create a new iRule a little different than your current one and then attach it to your HTTPS vip. something like this probably.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
*.domain.com {
Do nothing
}
default {
HTTP::redirect https://[HTTP::host].domain.com[HTTP::uri]
}
}
}
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