---
schema_version: "1"
id: 4b496e4ecd867207b810a37fabbf669c4c124df3ab5c91d0bc90d93cacb56231
title: Replace Static URLs
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/lex_prepare_vf_href.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.lex_prepare_vf_href.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 451e92051b76dc0df18177aa9735166449e0110216dc838943d185723bb1eafc
description: Lightning Experience doesn't support the use of static URLs to link to Salesforce resources. Fortunately, there's a much better alternative that future proofs your URLs. URLFOR is a function that calculates a URL based on inputs, rather than relying on something static that can't change. Use the URLFOR function with the appropriate action instead of direct URLs.
products:
  - Salesforce Platform
  - Cross Cloud
release: "264"
---
# Replace Static URLs

Lightning Experience doesn't support the use of static URLs to link to Salesforce resources. Fortunately, there's a much better alternative that future proofs your URLs. URLFOR is a function that calculates a URL based on inputs, rather than relying on something static that can't change. Use the URLFOR function with the appropriate action instead of direct URLs.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Group</strong>, <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d190331e70">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d190331e70 ">To create, edit, or delete Visualforce pages:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d190331e70 ">Customize Application</td>

          </tr>
        </tbody>
      </table>

Because static URLs can be applied in many ways, it’s not possible to cover all possibilities. Let’s look at a case where a static URL is used to link to the edit page for an account. Then you can use this example, including the code samples, as a guide for addressing other static URLs in your pages.

1. Locate href and .Id} in the Visualforce code.
    1. From Setup, enter Visualforce in the **Quick Find** box, then select **Visualforce Pages**.
    2. Click **Edit** next to the Visualforce page.
    3. Search the Visualforce markup for each of the following: href and .Id}.
        
        ```markup
        <apex:page standardController="Account" lightningStylesheets="true">    
          <apex:outputLink value="/{!Account.Id}/e" >Edit Account</apex:outputLink> 
        </apex:page>
        ```
2. Determine where the static URL is redirecting to. You can figure this out by testing the Visualforce page in Salesforce Classic.
3. Find the appropriate [URLFOR action](https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_variables_global_action_valid_values.htm) to replace window.location.
4. Replace all static URLs with URLFOR functions.
    
    ```markup
    <apex:page standardController="Account" lightningStylesheets="true">   
      <apex:outputLink value="{!URLFOR($Action.Account.Edit, Account.Id, null, true)}">Edit Account</apex:outputLink>   
    </apex:page>
    ```
5. Save your changes.