Importing a URL redirect file
If you are migrating your redirect configurations from a previous redirect service, you can import a CSV file containing the details of your redirect configurations.
Step 1: Prepare the redirect configuration file.
![](../images/redirects/screenshot-example_redirect_csv_file.png)
The table below explains the redirect configuration parameters that must appear as column headers in the CSV file exactly as they appear in the left column.
Column header | Type | Description | Example |
---|---|---|---|
Domain | string | The domain associated with the source URL — as in, the URL you want to direct traffic away from. | *.example.com |
FromPath | string | The URL path associated with the source URL. The path must begin with a slash (/) unless you are using a wildcard (*) in the first URL path segment. | / |
Target | string | The domain and URL path, if applicable, associated with the destination — as in, the URL to which you want to redirect traffic. | www.new.com |
Tags | array of keys or key-value pairs | (Optional) A list of nominal keys or key-value pairs to apply to a redirect configuration. | project:migration |
ForwardingMode | string (enum) | Indicates the path forwarding mode to apply to a redirect configuration: all, capture, or none. Refer to Path and query forwarding for details. | all |
ForwardingType | string (enum) | Indicates whether or not to enable redirects over HTTPS. If enabled, you must generate an SSL/TLS certificate for the corresponding domain in the NS1 Connect platform. Refer to SSL/TLS certificates for details. | permanent |
HttpsEnabled | boolean | Indicates whether or not to enforce redirects over HTTPS. | true |
HttpsForced | boolean | true | |
QueryForwarding | boolean | Indicates whether or not to append the query strings from incoming requests to the target URL. Refer to Path and query forwarding for details. | false |
Step 3: Add missing zones, if applicable.
If any of your source URLs in the imported redirect file do not correspond to an existing DNS zone, you must create the missing zone(s).
- Navigate to Redirects > Source and target URLs from the main navigation to view a list of redirect configurations.
- Note which source URLs appear with a warning icon next to them, indicating a missing zone. Tip: You can hover over each icon to determine whether it is due to a missing zone or conflicting record.
- Navigate to Zones from the main navigation to view a list of zones.
- Click Add zone.
- Enter the fully qualified domain name (FQDN) and other relevant details corresponding to the zone. Refer to Creating a primary zone for details.
- Save the zone.
After saving the zone, the warning icon should no longer appear next to the corresponding source URL(s) in the redirect configuration list.
Step 4: Delete conflicting records, if applicable.
When you save a redirect configuration, the NS1 Connect platform creates a REDIRECT record associated with the corresponding domain. The REDIRECT record type should not coexist with certain record types — including A, AAAA, CNAME, and ALIAS — for the same domain. If these conflicting record types exist for the domain, they will take precedence over the REDIRECT record and traffic will not be redirected. To resolve this issue after importing a redirect file, you must delete the conflicting record types.
- Navigate to Redirects > Source and target URLs from the main navigation to view a list of redirect configurations.
- Note which source URLs appear with a warning icon next to them, indicating the existence of a conflicting record type. Tip: You can hover over each icon to determine whether it is due to a missing zone or conflicting record.
- Navigate to Zones from the main navigation to view a list of zones, and
click the name of the zone within which the conflicting record types exist.Note: If the redirect references a subdomain as the source URL, the corresponding zone may reflect the root domain. For example, a record for foo.example.com may exist within a zone corresponding to example.com.
- Review the list of records carefully, and delete any A, AAAA, CNAME, or ALIAS record types for the relevant domain only.
After deleting the conflicting records, the warning icon should no longer appear next to the corresponding source URL(s) in the redirect configuration list.
Step 5: Review the auto-generated SSL/TLS certificates, if applicable.
If a redirect configuration defined in the imported file indicates that HTTPS is enabled, the NS1 Connect platform automatically generates an SSL/TLS certificate for the corresponding domain. As a final step, review the SSL/TLS certificates generated based on your uploaded file to ensure they correspond to the appropriate domains. Refer to SSL/TLS certificates for details.