Managing HTTP Redirects

The HTTP Redirect service allows you to redirect HTTP traffic to another URL. You can use HTTP Redirect to:

  • Redirect all HTTP traffic for an entire zone to another zone. For example, if a company owns example.net and example.com, HTTP Redirect lets the company redirect all HTTP traffic for example.net to example.com. This is a one-to-one mapping; wildcards are not supported.
  • Redirect a specific subdomain to an HTTP URL. For example, test.example.com can be redirected to http://example.net/test/test.php.
  • Redirect a subdomain to a URL with a port number. For example, camera.example.com can be redirected to http://office.example.com:8080 so a user can view their camera system without typing in the port number each time.
  • Permanently redirect a domain name that has been deprecated by displaying a 301 response code. Permanently redirecting a domain name informs search engines and browsers what to do with the information.

Required IAM Policies

To work with HTTP Redirects, you need to have a user login to the Console, and your user needs sufficient authority (by way of an IAM policy) to perform all the instructions that follow. If your user is in the Administrators group, you have the required authority.

If your user is not, then a policy like this would allow a specific group to manage HTTP Redirects:

Allow group <GroupName> to manage http-redirects in compartment <CompartmentName>

If you're new to policies, see Getting Started with Policies and Common Policies. For more details about policies for HTTP Redirect, see Details for the WAF Service.

Using the Console

To create an HTTP redirect
  1. Open the navigation menu. Under Core Infrastructure, go to Networking, DNS Management, and click HTTP Redirects.
  2. Select a zone.
  3. Click Create HTTP Redirect.
  4. In the Create Redirect dialog box, enter the following information:
    • Name: (Optional) Enter the name of the redirect zone you want to create. Avoid entering confidential information.
    • Select a Zone: (Optional) Select a zone from a list of configured zones. If the Create DNS Record check box is selected, the zone will be used to build an alias record for the redirect.
    • Domain: Enter the domain name from which traffic is redirected.
    • Target - Enter the following information for the endpoint where the traffic will be redirected:
      • Protocol: The network protocol used to interact with the target.
      • Host: The hostname of the target.
      • Port: (Optional) The port used to connect to the endpoint. The default is 80 for HTTP and 443 for HTTPS.
      • Path: (Optional) The specific path on the target for the redirect. A value of {path} will copy the path from the incoming request.
      • Query: (Optional) The query component of the target URL (for example, "?redirected" in "https://target.example.com/path/to/resource?redirected"). Use of the "\" character is not permitted except to escape a following "\", "{", or "}". An empty value results in a redirection target URL with no query component. A static value must begin with a leading "?", optionally followed by other query characters. A request-copying value must exactly match "{query}", and will be replaced with the query component of the request URL (including a leading "?" if the request URL includes a query component).
    • Response Code: The response code that is returned with the redirect. If your website was permanently moved to the redirection URL and you want it to be indexed by search engines, select 301 - Moved Permanently. If you want to indicate that the URL has been temporarily changed to a different address, select 302 - Found.
    • Create DNS Record: Select this check box to create an associated ALIAS record for the redirect in the specified zone. If a record for the zone specified already exists, the DNS record will not be created.
    • ALIAS TTL in Seconds - The Time to Live for the ALIAS record before a new ALIAS record is retrieved. The default value is 300.
    • Tags: If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you are not sure if you should apply tags, then skip this option (you can apply tags later) or ask your administrator.
  5. Click Create. The redirect zone is added to the redirects list.
To edit an HTTP redirect
  1. Open the navigation menu. Under Core Infrastructure, go to Networking, DNS Management, and click HTTP Redirects.
  2. Click the name of a redirect zone.
  3. Click Edit.
  4. In the Edit Redirect dialog box, make the needed changes and then click Save Changes.

To delete an HTTP redirect
  1. Open the navigation menu. Under Core Infrastructure, go to Networking, DNS Management, and click HTTP Redirects.
  2. Select a redirect zone.
  3. Click Delete.
  4. In the Delete Resource dialog box, click Delete HTTP Redirect. Any attached records will need to be managed in DNS Zone Management.

To move an HTTP redirect to another compartment
  1. Open the navigation menu. Under Core Infrastructure, go to Networking, DNS Management, and click HTTP Redirects.
  2. Click the name of a redirect zone.

  3. Click Move Resource.
  4. Choose the destination compartment from the list.
  5. Click Move Resource.