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.
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. -
hostnameis the domain name of the server. It can also include a port number or an IP address. -
portis the port number assigned when configuring Oracle REST Data Services. -
ordsis the service name defined when configuring Oracle REST Data Services. -
ris the router shortcut. This value is a constant and should never be changed. -
mycompanyis thepath_prefixwhich is the workspace path prefix used to build friendly URLs. 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-appis theapp_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-employeesis thepage_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=13766599855150identifies 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
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:
-
On the Workspace home page, click the App Builder icon.
-
Select an application.
The Application home page appears.
-
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.
-
-
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.
-
-
Click Apply Changes to save your changes.
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_prefixis the workspace path prefix used to build friendly URLs. 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_aliasis 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_aliasis 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- Changeexampletomycompany. -
app_alias- Change355tomyapp. -
page_alias- Change2tomyinfo.
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:
-
Sign in to Oracle APEX.
-
To change the Path Prefix:
-
Navigate to the Workspace Administration page. At the top of the Workspace home page, click the Administration menu and select Administration.
-
On the Workspace Administration home page, click Manage Service and then click Set Workspace Preferences.
-
Scroll down to SQL Workshop.
-
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.
-
Click Apply Changes to save your changes.
Manage Service page appears.
-
Return to the Workspace home page. Click the APEX logo (Oracle APEX Home) in the upper left corner.
-
-
To change the Application Alias:
-
On the Workspace home page, click the App Builder icon.
-
Select the application.
-
On Application home page, click the Edit Application Definition button.
The application Definition page appears.
-
Under Name, edit the Application Alias attribute. For example, enter
myapp. -
Click Apply Changes to save your changes.
-
-
To change the Page Alias:
-
View the page in Page Designer.
-
In either the Rendering tab, select the page name.
-
In the Property Editor, find the Identification group.
-
Under Identification, Page Alias attribute - Enter an alphanumeric alias for this page. For example, enter
myinfo. -
To save your changes, click Save or Save and Run Page.
-
-
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