Skip to main content

Oracle APEX 20.1 Friendly URLs

Friendly URLs! It's been one of the most wanted feature in APEX from very initial days. It's one of the main complaints we hear from customers, especially for websites which are open for public. There are several benefits of having a friendly URL besides better user experience.


Finally, the wait is over! APEX team has implemented this feature, probably in the most simplest way possible (for APEX developers). Big Kudos to the APEX Team. All you need to do is, just turn on a flag in application properties. Yes, you read it right..


Now, after enabling this flag, all APEX URLs will switch to new friendly URLs

New URL Format:

Example link - https://apex.oracle.com/pls/apex/hari/r/demo_app/home?session=714815362925554

Part-1: https://apex.oracle.com/pls/apex/ - Host details, there is no change here

Part-2: /hari/r - Here hari is work-space path prefix and r stands for router. You can modify "Path Prefix" at "Workspace Administration > Manage Service > Set Workspace Preferences" section. Path Prefix should be unique at APEX instance level. Also, irrespective of whether you give prefix name either in upper case or in lower case, in the url, it should be always called in lower case. For e.g. below link with upper HARI will throw 404 error. 

https://apex.oracle.com/pls/apex/HARI/r/demo_app/home?session=714815362925554

Part-3: /demo_app/home?session=714815362925554 - Here demo_app is application alias and home is target page alias. If no page alias is specified, then page number will be used in URL instead of page alias. After target page, first parameter should be specified after ? symbol and subsequent parameters should be specified after & symbol, like in most of the web based applications. 

example - https://apex.oracle.com/pls/apex/hari/r/demo_app/ig-bulk-operation?session=714815362925554&p5_commission=10&clear=5&request=TEST

Subsequent parameters, after page number, can be in any order. For e.g. session can be at the end or page items can be at the end, it really does not matter. Also, please always use APEX_PAGE.GET_URL function to get URL dynamically. APEX_PAGE.GET_URL will handle different cases automatically for you, be it checksum generation, or link to modal page from normal page or link to normal page from modal page or any other cases that may come in future, like friendly URLs in 20.1.

Backward Compatibility: 

Even after you turn "Friendly URLs" flag on, old format URLs would still work. So there is no need to change any old URL references or bookmarked URLs.

Here is the link to demo.

What do you think about this new cool feature? Do you like it?

Thank you.

Comments

Patrick Wolf said…
Hi, I just want to point out that if the page alias is set, it will be used instead of the page#, which makes the url even nicer. In addition, developers should not manually add friendly url syntax into their SQL queries, ... because those would not automatically add checksums. Best is to use the declarative 'Link Target' attribute in Page Designer, or use APEX_PAGE.GET_URL if they have to be dynamic. In all other places f?=p syntax should still be used, we will automatically rewrite them into friendly url syntax including checksum.

Regards
Patrick
Hari said…
Thank you Patrick. I have updated this post about page alias and importance of using APEX_PAGE.GET_URL.

What do you mean by "In all other places f?=p syntax should still be used"? Can you give an example?

Thank you.
Patrick Wolf said…
Thanks! I thought that List just had a text field for the link, but it actually has declarative attributes for the target. Anyway, I just wanted to make the point that nobody should manually write the friendly url syntax :-)
Unknown said…
Link to demo page does not work: Sorry, this page isn't available
Application "103639" Page "f" not found.

Contact your application administrator.
Hari said…
Thanks for reporting. I have fixed it.
Oraclawi said…
Hi, i have a report query URL against Oracle BiPublisher added to a page button, it was working fine with Oracle Apex 18.2, when i upgrade to Oracle Apex 20.1 whenever clicking the button the browser response with "The requested URL /apex/f was not found on this server", Can you help me please to solve this issue?
Hari said…
Hi,

You need to specify more details about the issue.

1) How was the upgrade done? Was the same APEX instance upgraded to 20.1 or have you migrated to different server with 20.1?
2) What else has been changed along with APEX? ORDS? Web Server?
3) Have you enabled "Friendly URLs" after migrating to 20.1?
4) Is it issue with one specific report or all the reports?

I suggest you to post your question in APEX Forums with all these details. https://community.oracle.com/community/groundbreakers/database/developer-tools/application_express
APEX Developer said…
Two steps forward, one step back. . I assume that it is a genuine effort to promote Apex rather than a requirement to leave the "/apex/" in the URL. We don't see things like "/wordpress/" required in their URLs. Also the /r/ seems to provide zero added value.

I know that old habits die hard, but I think that they APEX team is not fully understanding how damaging ugly URLs are to a broader use of APEX in the realm of publicly facing webapps.

The version 20.1 "friendly URL" feature is definitely a step in the right direction. I give it a 4 out of 10. The things that would raise that significantly would be:

1. Remove the /apex/
2. Remove the /r/
3. Find a way to pass parameters under the covers rather than through the URL. The new approach actually looks messier and worse to me when passing parameters.
thoughts said…
I am using Oracle Autonomous Transaction Processing. How do you use the new URL format in conjunction with a registered domain, for example abc.com? What would I do for the domain dns entry in Godaddy A record?
Hari said…
Hi,

1. apex.oracle.com was previously running with mod_plsql as webserver (pls) and apex was database access descriptor (DAD) name. I think Oracle has not changed the URL for backward compatibility, even though now apex.oracle.com uses ORDS. As you might be aware, while configuring APEX with ORDS, you can rename ords to apex or to any other name you want.
2. r stands for router. I think that's where the magic happens, converting normal urls into new format and vice versa based on "friendly url" flag
3. You can always use submit + branch approach when you want to pass several parameter values to other page. (of course it needs additional page submit)

Thank you.
Hari said…
Hi, I am not clear with your question. But if you are talking about mapping domain name to your APEX application on cloud, you may refer this blog post from Dimitri Gielis https://dgielis.blogspot.com/2019/12/free-oracle-cloud-17-configure-domain.html. If this is not what you are looking for, then I suggest to post your question at APEX forums https://bit.ly/2ZF9lUa

Popular posts from this blog

Interactive Grid - Conditional Enable/Disable

In this blogpost, I am going to discuss few approaches using which we can conditionally enable/disable Interactive Grid (IG) column(s) based on other column(s) values. Note:    There is a bug  30801170  in APEX 19.2/20.1 with respect to "enable/disable" dynamic actions for IG columns. Workaround for this bug is provided at the end of this blogpost . This bug has been fixed in APEX version 20.2. Client Side Only Conditions If conditions to enable/disable are simple, then we can check those conditions easily on the client side. For e.g. let's consider IG on EMP table with following SQL Query. SELECT EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO FROM EMP Let's consider the requirement as - Enable "Commission" column only when JOB is equals to 'SALESMAN' and disable "Commission" column in all other cases. This can be done declaratively using dynamic actions (DA) DA "Enable/Disable Commission - 1" Create DA and give it a prope

Interactive Grid - Bulk Operation on Selected Rows

What's the Problem? Let's say you have an IG on employee table and you want to update selected employees commission based on user's input. Ideally, it should be very simple, where you can write UPDATE statement in page process and select IG region as "Editable Region" under "Execution Options" of the page process. But, when you select rows and submit page, you can see that, this process won't get executed! The reason is  Selection of 'Row Selector' check-boxes is not considered as row-change. Thus selected rows are not submitted to server. So, is there any work around?  Yes! Luckily there are lot of JavaScript (JS) APIs available to work with IG. If you are not already aware, you can refer "APEX IG Cookbook"  or  JavaScript API Reference documentation. If we continue with above Employee IG example, when user selects IG rows, enters "Commission %" and clicks on "Update Commission" button, then we can writ

Few tips on Gantt Charts

Oracle APEX offers several beautiful chart types which are based on Oracle JET Data Visualizations. Gantt Chart is one such beautiful and useful chart. However, when I have searched in Google for some help on Gantt Charts, there are not many blogs posts talking about it. So, I thought, I could write one with few basic tips which I have learned this year. I have used Gantt Chart to display employees calendar data and my targeted output was something like below. Pic-1 Looks simple, correct? However, it's little tricky to get there. Multiple Tasks Per Row: When I look at the output, first I thought, I will have to write a query which gives tasks data and employee data with 1 row per task. That is, if there are 10 tasks to be displayed, then there should be 10 rows in SQL query output. But, it's not correct. Instead, I should have 1 row for each task + 1 row for each employee (parent). So I need to write a query which will output data in below format. Pic-2 A