I was annoyed that to get to my main PL/SQL page I have to type in a full URL like this:
(e.g. “mydad” could be “apex” for Oracle Apex)
If I was using Apache HTTP Server I’d do something this article suggests. But I’m using Oracle’s Embedded PL/SQL Gateway.
A. I got rid of the “:7777” by changing the HTTP port to 80, e.g.:
SQL> exec dbms_xdb.sethttpport(80);
Now, I can get to it without the port number:
B. Now I want to remove the need to remember to type “home”. To do this, I just tell the DAD what the default page is:
SQL> exec dbms_epg.set_dad_attribute('MYDAD','default-page','home');
Now, the url is a bit simpler:
The URL is now rewritten automatically to point to “mydad/home”.
C. Finally, I want to remove the need to specify the DAD. To do this is a little more complicated. I’ll create an XDB resource that will override the default XDB navigator that comes up.
- Log into Enterprise Manager
- Open the “Administration” tab and select “Resources” under “XML Database”
- Click “Create” and set the fields as follows:
Owner = SYS
Type = XML Database Resource File
Source = Specify the file contents
<html><head><meta http-equiv="REFRESH" content="0; URL=http://host/mydad"></head><body><a href="http://host/mydad">Home</a></body></html>
- Click “Ok”
(you’ll need to change “host” and “mydad” to appropriate values in the sample Contents above)
Now, the url is simply:
This causes it to load the index.html page from the XML database, which redirects to the DAD, the default page for which is “home”.