Data Flow – F5 HTTP/S Root (Apex) Redirect to Subdomain and How DNS Works


F5 Redirect Setup for Root (Apex) to WWW ( >
Root (Apex) “” IP =
WWW “” =


The flow would look something like this:
1. A client makes a request for ``.
2. The client’s DNS resolver queries for the IP address of ``.
3. The DNS server returns the IP address
4. The client sends the HTTP request to
5. Assuming that is the IP address of the F5 Load Balancer, the F5 receives the request and applies the redirect rule.
6. The F5 Load Balancer sends a response back to the client with a 301 or 302 HTTP status code, indicating the new location ``.
7. The client receives the redirect response and makes a new DNS query for the IP address of ``.
8. The DNS server returns the IP address
9. The client sends the HTTP request to, which is presumably the IP address of the desired web server.
10. The web server at processes the request and returns the response to the client.



In F5, you can create an iRule to handle the redirect from the root domain to the www subdomain. iRules are a powerful feature in F5 that enable you to manage network traffic by configuring custom scripts.

Please note that the exact steps can vary depending on the version of the BIG-IP system you’re using. Here’s a general example:

1. Log into your F5 BIG-IP system.
2. Go to the iRules section. This is typically located under “Local Traffic” > “iRules” > “iRule List“.
3. Create a new iRule. Click on “Create“, give your new iRule a name (e.g., “Redirect_Root_to_WWW“), and enter the following script in the “Definition” section:

    when HTTP_REQUEST {
        if { [HTTP::host] equals "" } {
            HTTP::respond 301 Location "[HTTP::uri]"

This iRule triggers when an HTTP request is made. If the host is ““, it responds with a 301 redirect to “” while preserving the URI path and query.

4. Apply the iRule to a virtual server. Go to “Local Traffic” > “Virtual Servers” and select the virtual server handling traffic for ““. Under “Resources“, find the “iRules” section and add your newly created iRule.

5. Save and Apply Changes.

After these steps, all HTTP requests to “” should be redirected to “”. If you’re using HTTPS, remember to change “http” to “https” in the iRule and make sure your F5 setup can handle SSL/TLS traffic.