URL forwarding (or URL redirecting) is a technique used to make a single web page available via multiple URLs. NS1 Managed or Dedicated DNS users can easily set up URL forwarding (HTTP redirects or masking) between zones using the NS1 portal or API.
![]() |
URL forwarding must be enabled on your account in order to create URLFWD records. Contact the NS1 support team by submitting a ticket or emailing support@ns1.com to enable this feature. |
Note: You must contact an NS1 support representative to enable the URL forwarding feature in the NS1 portal.
This article includes:
- How to create a new URL forwarding record
- via the NS1 portal
- via NS1 API
- How to view all URL forwarding records associated with a zone
- How to edit a URL forwarding record
- How to delete a URL forwarding record
- About path forwarding modes
Creating a new URL forwarding (URLFWD) record
To create a URLFWD record via the NS1 portal:
URL redirects can be configured by creating a URLFWD record that is associated with a specific zone.
-
In the NS1 portal (http://my.nsone.net), click the Zones tab.
-
Click to drill down into the specific zone within which you want to set up a URL redirect.
- Click Add Record.
Adding a URL forwarding (URLFWD) record to a zone that contains another resource record with the same name may result in unexpected behavior.
-
Under Record Type, select URLFWD from the drop-down menu.
-
Specify the subdomain for which you would like to apply the URLFWD record, or leave this field blank if you want to create the record at the root level.
- Specify a TTL in seconds. Default is 3600 seconds. Learn more about Best Practices for TTL configuration.
-
Under “From,” add a source path (subdirectory) with/without a wildcard to the URL or enter a root “/”. This is the page from which users will be redirected away. You cannot leave this field blank. You must at least include a / to indicate the root level path.
-
Under “To,” specify the target destination URL (including paths, if applicable). This is the page to which you want to direct end users.
-
Select the type of URL path forwarding you're setting up: Permanent (301), Temporary (302), or Masking.
- Permanent (301)
This type of redirect indicates to search engines that they should remove the old page from their database and replace it with the new target page. (Recommended for SEO.) - Temporary (302)
Less common, this type of redirect indicates to search engines that they should keep the old domain or page indexed as the redirect is only temporary. While both pages might appear in the search results, a temporary redirect suggests to the search engine that it should prefer the new target page. - Masking
This type of redirect preserves the redirected domain in the browser's address bar. This lets the user see the address they entered, even though the content displayed is coming from a different web page.
- Permanent (301)
-
Select an option next to Path Forwarding Mode. Path forwarding lets you forward the path after the domain name to the same path at the new domain. (Note: Refer the the end of this article for more information on path forwarding modes.) Use path forwarding when the domain you’re forwarding to has the same structure as the current domain. There are three path forwarding modes where you can specify how you want to append to the target path:
- All (appends the entire incoming path to the target destination)
- Capture (appends only the part of the incoming path that corresponds to the *)
- None (does not append any part of the incoming path)
-
Check the box to enable Query Forwarding. In doing so, you are allowing the query string of a URL to be applied directly to the new target URL . The query is indicated by the first question mark ("?").For example, http://sourceexample.com/page?val=34 where ?val=34 is the query attached to the end of the new target URL. If query forwarding is enabled, this segment of the path is automatically applied to the end of the target destination path. If query forwarding is disabled, the user is directed to the target destination (without the query appended).
-
To add another redirect for this zone, click Save & Add Record. Otherwise, click Save Record. The new redirect appears in the list under the URL Forwards tab.
Note: It may take up to a few minutes for your changes to propagate.
To create a URLFWD record via API:
Execute a PUT command to https://api.nsone.net/v1/zones/:zone/:domain/URLFWD to create a new URLFWD record.
For example:
curl -X PUT -H "X-NSONE-Key: $API_KEY" https://api.nsone.net/v1/zones/example.com/www.example.com/URLFWD -d '{"zone": "example.com", "domain": "www.example.com", "type": "URLFWD", "answers": [{"answer": ["/one", "http://one.com", 0, 0, 0]}, {"answer": ["/two", "http://two.com", 301, 1, 1]}, {"answer": ["/three", "http://three.com", 302, 2, 0]}]}'
where
- zone is the name of the zone to which you want to add the URLFWD record
- domain is the FQDN within the zone to which you want to add the URLFWD record
- type is the type of record you are creating (in this case, URLFWD)
- each answer specifies five values
- "from" path (ex. /one , /two. /three) indicated by the query
- domain (ex. http://one.com, etc.) to which you want to redirect the query
- forwarding type; either 0 (masking), 301 (permanent), 302 (temporary)
- query forwarding enabled or disabled; either 0 (disabled) or 1 (enabled)
Similar structures can be used with GET or POST commands to retrieve or update the record. For more information, refer to the NS1 API documentation.
Viewing all URL forwarding records associated with a zone:
- In the NS1 portal, click the Zones tab.
- Select a zone from the list to drill down into the specific zone settings, and then click the URL Forwards tab to view all redirects associated with the selected zone.
Note: You can search the list of URL forwarding records by name or filter by the type (permanent, temporary, masking), the path forwarding mode, and/or by those with query parameter forwarding enabled.
Editing a URL forwarding record:
-
In the NS1 portal, click the Zones tab and select the zone you want to modify.
-
Click the URL Forwards tab to view a list of all active redirects associated with that zone.
- Click the "edit" icon (pencil) next to the URLFWD record you want to edit.
- Make the desired changes, and then click Save Record.
Note: It may take up to a few minutes for your changes to propagate.
Deleting a URL forwarding record:
-
In the NS1 portal, click the Zones tab and select the zone you want to modify.
-
Click the URL Forwards tab to view a list of all active redirects associated with that zone.
- Click the "delete" icon (trash can) next to the URLFWD record you want to edit.
- When prompted, click Continue to confirm the changes.
Note: It may take up to a few minutes for your changes to propagate.
About path forwarding modes
A. Forwarding mode: “All”
This option appends the entire incoming path to the target destination. For example, if you configure the following redirect:
the following example shows how the incoming path is appended to the target
SEARCH |
RESULT |
www.aaa.com/foo/bar |
www.new.com/target/foo/bar |
As shown here, the entire path the user searches for is applied to the new target destination.
Note: The incoming path must match the structure of the defined “From URL” path exactly. Otherwise, their search will render “no match.” For example, if the source path is defined as http://www.source.com/foo/* and a user searches for http://www.source.com/bar, they will not be redirected to the target destination.
B. Forwarding mode: “Capture”
This option appends only the part of the incoming path that matches the * in the source path structure. For example, if you use the same example as above:
the following example shows how the incoming path is appended to the target
SEARCH |
RESULT |
www.aaa.com/foo/bar |
www.new.com/target/bar |
As shown here, the path segment that matches the location of the asterisk (*) defined in the source URL path is applied to the new target destination. In other words, even though the user searched for “/foo/bar,” only the “bar” carried over as this it correlates to the location of the * in the source URL path.
C. Forwarding mode: “None”
This option does not append any segment of the incoming path to the new target destination. In this case, all searches will redirect to the target destination exactly (depending on the structure) or render “no match.” For example, using the example above:
then selecting "None" as the forwarding mode will render the following results:
SEARCH |
RESULT |
www.aaa.com/foo/bar |
www.new.com/target |
www.aaa.com/bar |
No match* |
*”No match” is generated if the incoming (search) path does not adhere to the structure defined in the FROM URL.
Limitations:
- Support for HTTPS
Currently, NS1 does not support automatic redirection from HTTPS addresses. For example:
From To Supported? http://... http://... Yes http://... https://... Yes https://... https://... No https://... http://... No