Forum Discussion
https to https FQDN redirection
What is the irule for redirecting to https://abc.global.com, i tried below i rule but it doesn't help my requirement.
1. when HTTP_REQUEST { if { [HTTP::host] contains "abc" } { HTTP::redirect "https://abc.global.com[HTTP::uri]" } }
2. when HTTP_REQUEST { if { [string tolower [HTTP::host]] ends_with "abc" } { HTTP::redirect "http://abc.global.com:82[HTTP::uri]" } }
3. when HTTP_REQUEST { { HTTP::redirect " http://abc.global.com:82[HTTP::uri]" } }
4. when HTTP_REQUEST { if { [string tolower [HTTP::uri]] equals "abc" } { HTTP::redirect "; } }
7 Replies
Hi,
Based on your sentence, I would say that you should put in place the below irule
when HTTP_REQUEST { if { [HTTP::host] eq "abc" } { HTTP::redirect "https://abc.global.com[HTTP::uri]" } }
- Dineshsankar_31
Altostratus
i tried this also But the VIP having certificate. So when i do it will throw SSL error then after it will redirect to Fqdn. I want before ssl error it should redirect.
Hi,
That's not possible like this.
You need to have a valid certificate for abc too.
If you have more than one host name or domain on the same VS, you should use SNI feature at SSL level or a certificate with those names in the SAN field
- Yann_Desmarest_
Nacreous
Hi,
Based on your sentence, I would say that you should put in place the below irule
when HTTP_REQUEST { if { [HTTP::host] eq "abc" } { HTTP::redirect "https://abc.global.com[HTTP::uri]" } }
- Dineshsankar_31
Altostratus
i tried this also But the VIP having certificate. So when i do it will throw SSL error then after it will redirect to Fqdn. I want before ssl error it should redirect.
- Yann_Desmarest_
Nacreous
Hi,
That's not possible like this.
You need to have a valid certificate for abc too.
If you have more than one host name or domain on the same VS, you should use SNI feature at SSL level or a certificate with those names in the SAN field
- jaikumar_f5
Noctilucent
Can you give this a try, you may also should look at DNS suffixes option. That would be lot easier.
when HTTP_REQUEST { set URI [string tolower [HTTP::uri]] { HTTP::respond 301 Location "https://abc.global.com$URI" return } }
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