Oracle APEX URLs Untangled & SEOptimized


Published on

Oracle Application Express is using its own syntax to pass URL parameters, called the f?p syntax. In fact, there is only one standard URL search-path parameter: "p". This makes APEX URL’s less readable for users and very difficult to understand for search engines. In my session I will explain and demonstrate a few techniques to use standard URL syntax in conjunction with APEX, in order to present pretty URL’s to users and search engines, just using the APEX Listener and the database.

Published in: Technology, Design
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Oracle APEX URLs Untangled & SEOptimized

  1. 1. APEX URLs APEX URLs Untangled & SEOptimized Christian Rokitta
  2. 2. Questions • What are URLs (to humans and Search Engines) • How are APEX URLs different? • How can we optimize this? (using Oracle DB, ORDS, APEX only) • Why am I sitting in this conference room and not having a beer at the bar?
  3. 3. What is a URL? • A URL is human-readable text that was designed to replace the numbers (IP addresses) that computers use to communicate with servers. They also identify the (file) structure on the given website. • URLs describe a site or page to visitors and search engines. Keeping them relevant, compelling, and accurate is the key to ranking well.
  4. 4. Comparison of URLs for a Canon Powershot SD400 Camera 1. : 102-8372974- 4064145?v=glance&n=502394&m=ATVPDKIKX0DER &n=3031001&s=photo&v=glance 2. :
  5. 5. Benefits of URLs • Semantics URL should semantically make sense. This is helpful to both humans and search engines. • Relevancy Semantically correct URL are more likely to get search engine-referred traffic due to the keywords in the URL. These, like title tags, are used for determining relevancy and computing rankings.
  6. 6. APEX URLs - f?p Syntax • is the URL of the server • pls is the indicator to use the mod_plsql cartridge • apex is the database access descriptor (DAD) name. The DAD describes how HTTP Server connects to the database server so that it can fulfill an HTTP request. The default value is apex. • f?p= is a prefix used by Oracle Application Express • 4350 is the application being called • 1 is the page within the application to be displayed • 220883407765693447 is the session number
  7. 7. URLs and Search Engines “Help Google crawl your site more efficiently by indicating how we should handle parameters in your URLs.” “ Use this feature only if you're sure how parameters work. Incorrectly excluding URLs could result in many pages disappearing from search.”
  8. 8. URL Parameters & Google To Google, the APEX app seems to be one page?!
  9. 9. Transforming f?p Syntax Typical URL containing a query string: http://server/path/program?field1=value1&field2=value2&field3=value3... f?p=App:Page:Sess:Req:Debug:ClearCache:itemNames:itemValues:PrinterFriendly Possible to transform f?p syntax? Yes, using flexible parameters passing: http://server/path/!schema.ff?app=100&page=1&session=1234567 &item1=value1&item2=value2&item3=value3...
  10. 10. flexible f create or replace procedure apex_demo.ff(name_array in owa.vc_arr , value_array in owa.vc_arr) is type f_param_array is table of varchar2(32767) index by varchar2(20); v_f_p_arr f_param_array; v_f_p varchar2(32767); v_inames varchar2(32767); v_ivalues varchar2(32767); begin v_f_p_arr('app') := ''; v_f_p_arr('page') := ''; v_f_p_arr('session') := ''; v_f_p_arr('request') := ''; v_f_p_arr('debug') := ''; v_f_p_arr('clearcache') := ''; v_f_p_arr('printerfriendly') := ''; …
  11. 11. flexible f cont. … for i in 1 .. name_array.count loop if lower(name_array(i)) in ('app', 'page', 'session', 'request', 'debug', 'clearcache', 'printerfriendly') then v_f_p_arr(lower(name_array(i))) := value_array(i); else if length(v_inames) > 0 then v_inames := v_inames || ','; v_ivalues := v_ivalues || ','; end if; v_inames := v_inames || name_array(i); v_ivalues := v_ivalues || value_array(i); end if; end loop; …
  12. 12. flexible f cont. … f( v_f_p_arr('app')|| ':' || v_f_p_arr('page')|| ':' || v_f_p_arr('session')|| ':' || v_f_p_arr('request')|| ':' || v_f_p_arr('debug')|| ':' || v_f_p_arr('clearcache')|| ':' || v_inames || ':' || v_ivalues || ':' || v_f_p_arr('printerfriendly')); end ff;
  13. 13. Human Readable? http://server/path/!schema.ff?app=100&page=1&session=1234567 &item1=value1&item2=value2&item3=value3... http://server/pagetitle/language/(sub)content/....
  14. 14. URL prettifying using ORDS Utilizing RESTful Web Service call URIs to supply pretty, human readable URLs (formerly known as Oracle APEX Listener)
  15. 15. Resource Templates/Handlers
  16. 16. RESTful pretty URL APEX base url workspace name URI Resource Template URI Prefix (optional),P3_PROJECT:ENG,fifapex recommended: Peter Raganitsch, session “Going Public”
  17. 17. How do SEs find URLs Crawling “Google's crawl process begins with a list of web page URLs, generated from previous crawl processes, and augmented with Sitemap data provided by webmasters. As Googlebot visits each of these websites it detects links on each page and adds them to its list of pages to crawl. New sites, changes to existing sites, and dead links are noted and used to update the Google index.”
  18. 18. Sitemap
  19. 19. sitemap.xml <urlset xmlns="" xmlns:xsi= xsi:schemaLocation=" http://www.sitemaps. <url> <loc> </loc> </url> <url> <loc> </loc> </url> <url> <loc> </loc> </url> <url> <loc> </loc> </url> … </urlset> Update frequency of Sitemap: Google's Sitemaps crawler usually reacts to the update frequency of your Sitemap files. Or: set the crawl rate in Webmaster Tools.
  20. 20. robots.txt • A robots.txt file restricts access to your site by search engine robots that crawl the web. These bots are automated, and before they access pages of a site, they check to see if a robots.txt file exists that prevents them from accessing certain pages. • You need a robots.txt file only if your site includes content that you don't want search engines to index. If you want search engines to index everything in your site, you don't need a robots.txt file (not even an empty one). • in the root of the web site hierarchy!
  21. 21. robots.txt example User-agent: * Disallow: /cgi-bin/ Disallow: /tmp/ Disallow: /junk/ Allow: /directory1/myfile.html Sitemap: Sitemap:
  22. 22. Links in APEX: Tabs Solution: use list based navigation!
  23. 23. Visitor typing URLs? mostly, visitors only (want to) type the domain name or a part of it
  24. 24. typical architecture? Workspace 1 Workspace 2 app Y app Z app X Workspace 3 app A app B Webserver Oracle REST Data Services (aka APEX Listener) IP: 12.34.567.89
  25. 25. URL re-routing for the Poor
  26. 26. re-routing backend create or replace PROCEDURE redirect IS t_host VARCHAR2(250); t_redir proxy_rules%ROWTYPE; BEGIN t_host := OWA_UTIL.get_cgi_env('host'); SELECT * INTO t_redir FROM (SELECT * FROM proxy_rules WHERE UPPER(t_host) LIKE UPPER(host_pattern) /* matching rules */ ORDER BY seq, id) WHERE ROWNUM < 2; IF t_redir.url_type = 'X' THEN f(p => t_redir.apex_app || ':' || t_redir.apex_page || ':' || t_redir.apex_session); ELSE OWA_UTIL.redirect_url(curl => t_redir.redir_url, bclose_header => TRUE); END IF; EXCEPTION WHEN OTHERS THEN OWA_UTIL.redirect_url(curl => '', bclose_header => TRUE); END redirect;​
  27. 27. defaults.xml for re-routing <entry key="misc.defaultPage">apex</entry> <entry key="misc.defaultPage">redirect</entry> (public synonym & grant execute to PUBLIC)
  28. 28. Questions & Discussion @crokitta