F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

nov1ce_120072's avatar
nov1ce_120072
Icon for Nimbostratus rankNimbostratus
Oct 13, 2014

Help with http to https redirect

Hello,

 

Grateful for any assistance with the following issue.

 

We have one VS serving http and https traffic for domain1.org. The redirect from http to https is done via HTTP Class profile:

 

Local Traffic > Profiles > Protocol > HTTP Class > http2https:

 

Parent Profile: httpclass

 

Hosts: Match all

 

URI Paths: Match all

 

Headers: Match all

 

Cookies: Match all

 

Send To: Redirect to

 

Redirect to Location: https://[getfield [HTTP::host] ":" 1][HTTP::uri]

 

This works perfectly fine for domain1.org.

 

Now we would like to add additional domain: domain2.org, pointing to the same IP address, however there is no SSL certificate deployed for domain2.org. So when users enter http://domain2.org, they are redirected to https://domain2.org, which generates a warning about certificate mismatch. If accepted it redirects to https://domain1.org.

 

Is there any way to configure a VS to redirect from http://domain2.org to https://domain1.org? Do I need to create a separate VS (with a separate IP for domain2.org)?

 

Thank you.

 

5 Replies

  • I would use an iRule to do this - something along these lines : when HTTP_REQUEST { if { [string tolower [HTTP::host]] ends_with ".domain2.org" } { HTTP::redirect "https://www.domain1.org[HTTP::uri]" } }

     

  • I would use an iRule to do this - something along these lines : when HTTP_REQUEST { if { [string tolower [HTTP::host]] ends_with ".domain2.org" } { HTTP::redirect "https://www.domain1.org[HTTP::uri]" } }

     

  • I'm afraid I disagree. I'd modify your class and change it to this;

    Redirect to Location: https://domain1.org/[HTTP::uri]