3.8.1 Understanding Friendly URL Syntax

Friendly URL Syntax creates a URL structure that identifies the address of Oracle APEX, the application, the page, and uses standard web parameter syntax.

Note:

The Friendly URL Syntax described in this section is different from a vanity URL or custom domain name. Configuring a vanity URL (or custom domain name) for your APEX instance is typically done at the web server or load balancer-level and is not discussed in this publication.

Tip:

Applications created using Application Express release 20.1 or later use Friendly URL Syntax. You can revert to f?p Syntax by disabling the Friendly URLs attribute.

3.8.1.1 About Friendly URL Syntax

Friendly URL Syntax uses a standard URL hierarchy and passes parameters in a similar fashion to other web applications.

Friendly URL Hierarchy and Syntax

Friendly URL Syntax creates a URL with the following directory hierarchy and syntax:

https://hostname:port/ords/r/path_prefix/app_alias/page_alias?parameters

Friendly URL Example

https://hostname:port/ords/r/mycompany/hr-app/update-employees?session=13766599855150

Where:

  • https: stands for HyperText Transfer Protocol and operates at the application layer.
  • hostname is the domain name of the server. It can also include a port number or an IP address.
  • port is the port number assigned when configuring Oracle REST Data Services.
  • ords is the service name defined when configuring Oracle REST Data Services.
  • r is the router shortcut. This value is a constant and should never be changed.
  • mycompany is the path_prefix which is URI path prefix used to access RESTful Services. When you create a workspace, this value defaults to workspace name. You can customize the URI path prefix by editing the Path Prefix attribute in Administration, Manage Service, Workspace Preferences, SQL Workshop.
  • hr-app is the app_alias. In a new application, the Application Alias defaults to the application Name. You can edit the Application Alias in the application Definition. The Application Alias must be unique within the workspace.
  • update-employees is the page_alias. In a new application, the Page Alias defaults to the page Name. You can edit the Page Alias in Page Designer. Page aliases must be unique within the application. When creating a new page, if a Page Name is already used as a Page Alias, then a numeric value is appended to the new Page Alias to make it unique.
  • ?session=13766599855150 identifies the session ID. When you run an application, the Oracle APEX engine generates a session number that serves as a key to the user's session state.

About URL Parameters

The part of the URL after /? can list parameters.

http://hostname:port/ords/r/path_prefix/app_alias/page_alias?parameters (Such as —
        p7_customer_id=377&clear=7&session=1247058356345&cs=3MdkfQa9NLmkyHAbwGPg3U-nmA7XIw5sWjU2rMzSvOy_wP1_z7BBI-Gbh2JgvffARgcYJy8id4VtL3d0l1tYm0w)

Supported parameters include:

  • session
  • request
  • clear
  • debug
  • application/page items
  • printerFriendly
  • trace
  • timezone
  • lang
  • territory
  • cs
  • dialogCs
  • x01

3.8.1.2 Enabling or Disabling Friendly URL Syntax

Determine if an application uses Friendly URL Syntax or f?p Syntax by enabling or disabling the Friendly URLs attribute.

Applications created using Oracle APEX release 20.1 or later use Friendly URL Syntax. You can revert to f?p Syntax by disabling the Friendly URLs attribute.

To enable Friendly URL Syntax:

  1. On the Workspace home page, click the App Builder icon.
  2. Select an application.
    The Application home page appears.
  3. Navigate to the Edit Application Definition page. Navigation options include:
    • Click the Edit Application Definition button.
    • From Shared Components:
      • Click Shared Components.

      • Under Application Logic, click Application Definition.

    The Definition page appears.

  4. Under Properties, configure the Friendly URLs attribute:
    • On - If set to On, application uses Friendly URLs Syntax in which the URL consists of a directory structure based on the Application Alias, Page Alias, and standard web parameter syntax.
    • Off - If set to Off, the application uses f?p= Syntax.
  5. Click Apply Changes to save your changes.

3.8.1.3 Customizing a Friendly URL

Customize a Friendly URL by editing the Path Prefix, Application Alias, or Page Alias.

Friendly URL Syntax creates a URL with the following directory hierarchy and syntax:

https://hostname:port/ords/r/path_prefix/app_alias/page_alias?parameters

You can customize the follow parts of Friendly URL:

  • Path Prefix - path_prefix is URI path prefix to be used to access RESTful Services. When you create a workspace, this value defaults to workspace name. You can customize the URI path prefix by editing Path Prefix attribute in Workspace Administration.
  • Application Alias - app_alias is an alternate alphanumeric application identifier called the Application Alias. In a new application, the Application Alias defaults to the application Name. You can edit the Application Alias in the application Definition.
  • Page Alias - page_alias is an alphanumeric alias for this page called the Page Alias. In a new application, the Page Alias defaults to the page Name. You can edit the Page Alias in Page Designer.

Friendly URL Customization Example

Suppose you have an application with the following URL:

http://hostname:port/ords/r/example/355/2?session=13766599855150

Suppose you want to make the following changes:

  • path_prefix - Change example to mycompany.
  • app_alias - Change 355 to myapp .
  • page_alias - Change 2 to myinfo.

The revised URL will display as:

http://hostname:port/ords/r/mycompany/myapp/myinfo?session=13766599855150 

To customize a Friendly URL by editing the Path Prefix, Application Alias, or Page Alias:

  1. Sign in to Oracle APEX.
  2. To change the Path Prefix:
    1. Navigate to the Workspace Administration page. At the top of the Workspace home page, click the Administration menu and select Administration.
    2. On the Workspace Administration home page, click Manage Service and then click Set Workspace Preferences.
    3. Scroll down to SQL Workshop.
    4. In Path Prefix, enter a new Path Prefix. In a new workspace, Path Prefix defaults to the workspace name. For example change the Path Prefix to mycompany.

      Tip:

      Path Prefix only displays if Enabled RESTful Services is set to Yes.

    5. Click Apply Changes to save your changes.
      Manage Service page appears.
    6. Return to the Workspace home page. Click the APEX logo (Oracle APEX Home) in the upper left corner.
  3. To change the Application Alias:
    1. On the Workspace home page, click the App Builder icon.
    2. Select the application.
    3. On Application home page, click the Edit Application Definition button.
      The application Definition page appears.
    4. Under Name, edit the Application Alias attribute. For example, enter myapp.
    5. Click Apply Changes to save your changes.
  4. To change the Page Alias:
    1. View the page in Page Designer.
    2. In either the Rendering tab, select the page name.
    3. In the Property Editor, find the Identification group.
    4. Under Identification, Page Alias attribute - Enter an alphanumeric alias for this page. For example, enter myinfo.
    5. To save your changes, click Save or Save and Run Page.
  5. Run the page. Click or Save and Run Page.
    The revised URL displays as:
    http://hostname:port/ords/r/mycompany/myapp/myinfo?session=13766599855150 

See Also:

Enabling RESTful Services and Defining a Path Prefix for a Workspace in Oracle APEX Administration Guide