1 2 Previous Next 19 Replies Latest reply on Mar 7, 2011 10:41 AM by fac586 Go to original post
      • 15. Re: Nice URLs for HTML DB?
        479162
        Here is a solution using mod_rewrite, that works quite well:
        RewriteEngine on
        Options +FollowSymLinks
        
        # handle wwv_flow
        RewriteRule ^/node/wwv_flow(.*) /pls/apex/wwv_flow$1 [PT,L]
        
        # ugly url
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/pls/apex/f?p=106:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)
        RewriteRule ^/pls/apex/ /node/%1.html?%2&%3&%4&%5&%6&%7&%8 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/pls/apex/f?p=106:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)
        RewriteRule ^/pls/apex/ /node/%1.html?%2&%3&%4&%5&%6&%7 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/pls/apex/f?p=106:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)
        RewriteRule ^/pls/apex/ /node/%1.html?%2&%3&%4&%5&%6 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/pls/apex/f?p=106:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)
        RewriteRule ^/pls/apex/ /node/%1.html?%2&%3&%4&%5 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/pls/apex/f?p=106:([^:]*):([^:]*):([^:]*):([^:]*)
        RewriteRule ^/pls/apex/ /node/%1.html?%2&%3&%4 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/pls/apex/f?p=106:([^:]*):([^:]*):([^:]*)
        RewriteRule ^/pls/apex/ /node/%1.html?%2&%3 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/pls/apex/f?p=106:([^:]*):([^:]*)
        RewriteRule ^/pls/apex/ /node/%1.html?%2 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/pls/apex/f?p=106:([^:]*)
        RewriteRule ^/pls/apex/ /node/%1.html [R,L]
        
        # medium nice url
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/f?p=106:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)
        RewriteRule ^/node/ /node/%1.html?%2&%3&%4&%5&%6&%7&%8 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/f?p=106:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)
        RewriteRule ^/node/ /node/%1.html?%2&%3&%4&%5&%6&%7 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/f?p=106:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)
        RewriteRule ^/node/ /node/%1.html?%2&%3&%4&%5&%6 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/f?p=106:([^:]*):([^:]*):([^:]*):([^:]*):([^:]*)
        RewriteRule ^/node/ /node/%1.html?%2&%3&%4&%5 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/f?p=106:([^:]*):([^:]*):([^:]*):([^:]*)
        RewriteRule ^/node/ /node/%1.html?%2&%3&%4 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/f?p=106:([^:]*):([^:]*):([^:]*)
        RewriteRule ^/node/ /node/%1.html?%2&%3 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/f?p=106:([^:]*):([^:]*)
        RewriteRule ^/node/ /node/%1.html?%2 [R,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/f?p=106:([^:]*)
        RewriteRule ^/node/ /node/%1.html [R,L]
        
        # very nice url
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/([^?]*)\.html?([^&]*)&([^&]*)&([^&]*)&([^&]*)&([^&]*)&([^&]*)&([^&]*)
        RewriteRule ^/node/ /pls/apex/f?p=106:%1:%2:%3:%4:%5:%6:%7:%8 [PT,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/([^?]*)\.html?([^&]*)&([^&]*)&([^&]*)&([^&]*)&([^&]*)&([^&]*)
        RewriteRule ^/node/ /pls/apex/f?p=106:%1:%2:%3:%4:%5:%6:%7 [PT,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/([^?]*)\.html?([^&]*)&([^&]*)&([^&]*)&([^&]*)&([^&]*)
        RewriteRule ^/node/ /pls/apex/f?p=106:%1:%2:%3:%4:%5:%6 [PT,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/([^?]*)\.html?([^&]*)&([^&]*)&([^&]*)&([^&]*)
        RewriteRule ^/node/ /pls/apex/f?p=106:%1:%2:%3:%4:%5 [PT,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/([^?]*)\.html?([^&]*)&([^&]*)&([^&]*)
        RewriteRule ^/node/ /pls/apex/f?p=106:%1:%2:%3:%4 [PT,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/([^?]*)\.html?([^&]*)&([^&]*)
        RewriteRule ^/node/ /pls/apex/f?p=106:%1:%2:%3 [PT,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/([^?]*)\.html?([^&]*)
        RewriteRule ^/node/ /pls/apex/f?p=106:%1:%2 [PT,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node/([^?]*)\.html
        RewriteRule ^/node/ /pls/apex/f?p=106:%1 [PT,L]
        RewriteCond %{REQUEST_URI}%{QUERY_STRING} ^/node
        RewriteRule ^/node/ /pls/apex/f?p=106 [PT,L]
        This system uses URLs of the form /node/1.html?param1&param2&param3&... and is also able to handle page aliases, i.e. you can use URLs like /node/index.html as well.
        It also handles the problem of ugly URLs being generated by APEX - if the server receives an ugly URL, it rewrites the URL to a nice URL and redirects the browser to the nice URL. The user is not allowed to directly access /pls/apex, which solves the problem of having duplicated content indexed by search engines.

        The above example shows the application with the id 106 being hidden under /node/, however it would be possible to hide all applications of APEX, and incorporate the application id into the URL (e.g. making the above application accessible under /apps/106/ or using an application alias and using /apps/webshop/). This would make /pls/apex completely inaccessible to the user.
        • 16. Re: Nice URLs for HTML DB?
          593342
          that's a good start. but what's the Options +FollowSymLinks for?

          also, it seems a bit heavy because of the number of rules that get evaluated. did you test this set of rules in a production environment? and does it keep the road for performance?

          I'd like to do exacly what you have written to simplyfy urls for search engines.
          There seems to be a problem with addresses that look like:
          http://server.com/pls/htmldb/f?p=105:1:xxxxxxxx::::VAR1_NAME,VAR2_NAME:value1,value2
          the last comma gets transformed to %2C first, then on the second rewrite rule, % gets transformed to %25. So in the final link, I get %252C which doesn't parse correctly. know any way to tell mod_rewrite (or Apache) not to transform special characters?
          • 17. Re: Nice URLs for HTML DB?
            723295
            subscribe
            • 18. Re: Nice URLs for HTML DB?
              egudai-Oracle
              Hello Martin,

              My Name is Etay and We have published a website (Apex 4.x) few weeks ago : (http://www.postme.co.il)
              In order for google to rank the website correctly (page zero - is not indexing well yet), I have tried your post here.
              Im not sure what I am doing wrong ...as copy passed all to the relevant virtual host.
              Should I also add Alias / Directory definiftion to "node" in the httpd.conf (under the relevant virtual host) ?
              As We would like to use the mode re-write

              We are also familiar with the following solutions.

              http://ora-00001.blogspot.com/2009/07/creating-rest-web-service-with-plsql.html

              http://monkeyonoracle.blogspot.com/2010/02/nice-url-in-public-facing-oracle-apex.html

              Regards
              Etay G.
              • 19. Re: Nice URLs for HTML DB?
                fac586
                >
                Hello Martin,

                My Name is Etay and We have published a website (Apex 4.x) few weeks ago : (http://www.postme.co.il)
                In order for google to rank the website correctly (page zero - is not indexing well yet), I have tried your post here.
                >

                Please do not post follow-ups to ancient threads. Doing so means: other users may ignore the thread as it appears to be closed; the assumption that the questions are related may be incorrect, leading to confusion about the nature of the problem and potential solutions; watches on the thread may have expired, so the original participants may be unaware of the new post, or they may no longer be active on the forum; you have no ability to mark posts as helpful or correct.

                "Martin" whom you have specifically asked for help made just this one post 4 years ago and is now presumably long gone from the OTN forums. He has NO IDEA you or your question exist.

                Post your question as a new thread, including as much relevant information as possible, typically:

                - APEX version
                - DB version and edition
                - Web server architecture (EPG, OHS or APEX listener)
                - Browser(s) used
                - Theme
                - Templates
                - Region type

                If you think your question is related to other posts and threads, link to them using the methods in the FAQ.
                1 2 Previous Next