---
schema_version: "1"
id: 5ce070e0b5ccc2195df2100bf64bffa3a0d9ee40bae43647e3897f09215b907f
title: Navigate To URL
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/lightning-base-components/lightning-design-system/guides/aura/components/force/navigateToURL/force-navigate-to-url.md
canonical_url: https://developer.salesforce.com/docs/platform/lightning-component-reference/guide/force-navigate-to-url.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9169de9653368d9cdf4fc22f4de7b0c4e7e3cd9f4aafe59669148350b472c740
products:
  - Lightning Component Reference
---
# Navigate To URL

**`force:navigateToURL`**

Navigates from a custom component to the specified URL.

**For Use In**

Lightning Experience, Experience Builder Sites, Salesforce Mobile App

::::::tabset{tabs='[ "Develop", "Specifications"]'}

:::::tab

Instead of using `force:navigateToURL`, we recommend navigating to web pages using the `lightning:navigate` component with the `standard__webPage` page type. For more information, see the [Lightning Aura Components Developer Guide](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_navigation_page_definitions.htm).

Relative and absolute URLs are supported. Relative URLs are relative to the Salesforce mobile web domain, and retain navigation history. External URLs open in a separate browser window.

Use relative URLs to navigate to different screens within your app. Use external URLs to allow the user to access a different site or app, where they can take actions that don’t need to be preserved in your app. To return to your app, the separate window that’s opened by an external URL must be closed when the user is finished with the other app. The new window has a separate history from your app, and this history is discarded when the window is closed. This also means that the user can’t click a Back button to go back to your app; the user must close the new window.

`mailto:`, `tel:`, `geo:`, and other URL schemes are supported for launching external apps and attempt to "do the right thing". However, support varies by mobile platform and device. `mailto:` and `tel:` are reliable, but we recommend that you test any other URLs on a range of expected devices.

When using `mailto:` and `tel:` URL schemes, consider using `lightning:formattedEmail` and `lightning:formattedUrl` components.

This example navigates a user to the opportunity page, `/006/o`, using a relative URL.

```javascript
gotoURL : function (component, event, helper) {
    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
      "url": "/006/o"
    });
    urlEvent.fire();
}
```

This example opens an external website when the link is clicked.

```javascript
navigate : function(component, event, helper) {

    //Find the text value of the component with aura:id set to "address"
    var address = component.find("address").get("v.value");

    var urlEvent = $A.get("e.force:navigateToURL");
    urlEvent.setParams({
      "url": 'https://www.google.com/maps/place/' + address
    });
    urlEvent.fire();
}
```

This event is handled by the `one.app` container. It’s supported in Lightning Experience, the Salesforce mobile app, and Aura-based Experience Builder sites. However, Experience Builder sites don't support force.com URL navigation with the `force:navigateToURL` event.


:::::

:::::tab
## Attributes

| Name         | Description                                                                                                                                                                          | Type    | Default | Required                                     |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------- | ------- | -------------------------------------------- |
| `isredirect` | When redirecting in place, this attribute prevents the creation of multiple history entries in hybrid environments. In this case, hybrid treats redirects as a single history entry. | boolean | false   |                                              |
| `networkId`  | Inherited. Network that the event is associated with.                                                                                                                                | string  |         |                                              |
| `url`        | The URL of the target.                                                                                                                                                               | string  |         | ![Yes](https://developer.salesforce.com/media/check.png) |

:::::

::::::
