HTTP Redirects

The DNS service lets you redirect HTTP traffic to another URL.

You can use HTTP redirects 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 aren't 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.
Important

During the Create HTTP redirect workflow, it's important that you check the Create DNS record option so that when the redirect is created, OCI deploys a record for redirect.waf.oci.oraclecloud.net. OCI deploys an ALIAS record for root (apex) domains and CNAME records for non root (apex) domains.

If you don't check the Create DNS record, there's no option to later edit the redirect to obtain the record for redirect.waf.oci.oraclecloud.net. You must either delete the redirect and start over, or manually add the record to the DNS.

This record must be added to the originating DNS zone for the redirect to work.

Required IAM Policies

To use Oracle Cloud Infrastructure, you must be granted security access in a policy  by an administrator. This access is required whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you get a message that you don’t have permission or are unauthorized, verify with your administrator what type of access you have and which compartment  to work in.

A policy like this allows 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 DNS Policy Reference.