30
APEX URLs APEX URLs Untangled & SEOptimized Christian Rokitta

Oracle APEX URLs Untangled & SEOptimized

Embed Size (px)

DESCRIPTION

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.

Citation preview

Page 1: Oracle APEX URLs Untangled & SEOptimized

APEX URLsAPEX URLs Untangled & SEOptimized

Christian Rokitta

Page 2: Oracle APEX URLs Untangled & SEOptimized

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?

Page 3: Oracle APEX URLs Untangled & SEOptimized
Page 4: Oracle APEX URLs Untangled & SEOptimized
Page 5: Oracle APEX URLs Untangled & SEOptimized

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.

Page 7: Oracle APEX URLs Untangled & SEOptimized

Benefits of URLs

• SemanticsURL should semantically make sense. This is helpful to both humans and search engines.

• RelevancySemantically 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.

Page 8: Oracle APEX URLs Untangled & SEOptimized

APEX URLs - f?p Syntax

• apex.somewhere.com 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

urlsyntax.oracleapex.com

http://apex.somewhere.com/pls/apex/f?p=4350:1:220883407765693447

Page 9: Oracle APEX URLs Untangled & SEOptimized

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.”

Page 10: Oracle APEX URLs Untangled & SEOptimized

URL Parameters & Google

To Google, the APEX app seems to be one page?!

Page 11: Oracle APEX URLs Untangled & SEOptimized

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...

Page 12: Oracle APEX URLs Untangled & SEOptimized

flexible fcreate 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') := '';

Page 13: Oracle APEX URLs Untangled & SEOptimized

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;…

Page 14: Oracle APEX URLs Untangled & SEOptimized

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;

Page 15: Oracle APEX URLs Untangled & SEOptimized

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/....

Page 16: Oracle APEX URLs Untangled & SEOptimized

URL prettifying using ORDS

Utilizing RESTful Web Service call URIs to supply pretty, human readable URLs

(formerly known as Oracle APEX Listener)

Page 17: Oracle APEX URLs Untangled & SEOptimized

Resource Templates/Handlers

http://www.themes4apex.nl/apex/rokit/t4a/examples/ENG/fifapex

Page 18: Oracle APEX URLs Untangled & SEOptimized

RESTful pretty URL

http://www.themes4apex.nl/apex/rokit/t4a/examples/eng/fifapex

APEX base urlworkspac

ename

URI Resource TemplateURI Prefix

(optional)

http://www.themes4apex.nl/apex/f?p=104:3:0::::T4A_LANG,P3_PROJECT:ENG,fifapex

recommended: Peter Raganitsch, session “Going Public”http://www.oracle-and-apex.com/hrurl-human-readable-urls-in-oracle-apex/

Page 19: Oracle APEX URLs Untangled & SEOptimized

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.”

Page 20: Oracle APEX URLs Untangled & SEOptimized

Sitemap

Page 21: Oracle APEX URLs Untangled & SEOptimized

sitemap.xml<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas

<url><loc>http://themes4apex.com/apex/f?p=T4A:Home:0::::T4A_LANG:NL</loc>

</url><url>

<loc>http://themes4apex.com/apex/f?p=T4A:Home:0::::T4A_LANG:ENG</loc>

</url><url>

<loc>http://themes4apex.com/apex/f?p=T4A:Service:0::::T4A_LANG:NL</loc>

</url><url>

<loc>http://themes4apex.com/apex/f?p=T4A:Service:0::::T4A_LANG:ENG</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.

Page 22: Oracle APEX URLs Untangled & SEOptimized

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!

Page 23: Oracle APEX URLs Untangled & SEOptimized

robots.txt example

User-agent: *Disallow: /cgi-bin/Disallow: /tmp/Disallow: /junk/Allow: /directory1/myfile.htmlSitemap: http://www.mysite.com/sitemaps/profiles-sitemap.xmlSitemap: http://www.othersite.nl/news/sitemap_index.xml

Page 24: Oracle APEX URLs Untangled & SEOptimized

Links in APEX: Tabs

Solution: use list based navigation!

Page 25: Oracle APEX URLs Untangled & SEOptimized

Visitor typing URLs?

mostly, visitors only (want to) type the domain name or a part of it

Page 26: Oracle APEX URLs Untangled & SEOptimized

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)

www.domain1.comdev.domain1.comtest.domain1.com

www.domain1.nldev.domain1.nltest.domain1.nl

www.domain2.com

www.domain3.comIP: 12.34.567.89

Page 27: Oracle APEX URLs Untangled & SEOptimized

URL re-routing for the Poor

Page 28: Oracle APEX URLs Untangled & SEOptimized

re-routing backendcreate or replace PROCEDURE redirectIS   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 => 'http://www.rokit.nl', bclose_header => TRUE);END redirect;

Page 29: Oracle APEX URLs Untangled & SEOptimized

defaults.xml for re-routing

<entry key="misc.defaultPage">apex</entry>

<entry key="misc.defaultPage">redirect</entry>(public synonym & grant execute to PUBLIC)

Page 30: Oracle APEX URLs Untangled & SEOptimized

Questions & Discussion

http://rokitta.blogspot.com

@crokitta

[email protected]

http://www.themes4apex.com

? ? ?

http://plus.google.com/+ChristianRokitta

http://nl.linkedin.com/in/rokit/