Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Overview

Friendly URLs in the past had a number of limitations not the least of which was the requirement of the "/go/" prefix and the inability to easily add url attributes in addition to the friendly url string.

Friendly URLs were re-factored in FarCry 5.1

If you are using FarCry 5.0.x you should refer to the following document for Friendly URL information: Friendly URL Configuration

Implementation

We are attempting offer 2 things in FarCry 5.1

  1. Offer a friendly url string (that requires no prefix) that when typed after your domain name will be replaced with the relevent objectid from your application
  2. Provide a URL syntax that allows you define the type, objectid, template view and body view webskins

Part 1. Friendly URL String

This is done by including the following in your apache virtual or conf (Apache Only):

##### APACHE VERSION
RewriteEngine On
RewriteCond %{REQUEST_URI} !(/farcry|/webtop|/flex2gateway|/flashservices)($|/)
RewriteRule ^([a-zA-Z0-9\/\-\%:\[\]\{\}\|\;\<\>\?\,\*\!\@\#\$\ \(\)\^_`~]*)$ /index.cfm?furl=$1 [L,PT,QSA]

For IIS you will need to install an ISAPI Rewrite dll and use the following redirect

##### IIS VERSION
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteCond %{REQUEST_URI} !(/farcry|/webtop|/flex2gateway|/flashservices)($|/)
RewriteRule ^(.*)$ /index.cfm?furl=$1&%1

Here is an example of how you would set up the rewrite for a sub-directory installation. Notice that the RewriteRule specifies the subdirectories at the start, and redirects to that subdirectory in the rewrite.

##### APACHE VERSION
RewriteEngine On
RewriteCond %{REQUEST_URI} !(/farcry|/webtop|/flex2gateway|/flashservices)($|/)
RewriteRule ^/(subdirectory1|subdirectory2)([a-zA-Z0-9\/\-\%:\[\]\{\}\|\;\<\>\?\,\*\!\@\#\$\ \(\)\^_`~]*)$ /$1/index.cfm?furl=$2 [L,PT,QSA]

This essentially redirects to the index.cfm any url without a "." in it (ie, index.cfm, main.css, fotm.js) and not under the folders specified in the exception (/farcry, /webtop, /flex2gateway, /flashservices).

For Example

On the page request, the farFU table is searched for the url.furl attribute. If it is found, then the url.objectid is populated with the relevent objectid just like prior to 5.1

Part 2. URL Syntax (type, objectid, view, bodyView)

As of FarCry 5.1 you can use the following url syntax as a friendly url string and if the specific friendly url string is not found in the database, it is converted to the standard url parameters most often used to access content in the system.

On the page request, the farFU table is searched for the url.furl attribute. When it is not found the url.furl attribute is parsed and turned into the following url variables:

  • url.type = dmnews
  • url.objectid = C98A815E-20F5-4F4E-9562C8400356C706
  • url.view = displayPageStandard
  • url.bodyView = displayBody

As you can see, the friendly url above is identical to typing the following in the browser http://localhost/index.cfm?type=dmNews&objectid=C98A815E-20F5-4F4E-9562C8400356C706&view=displayPageStandard&bodyView=displayBody

Of course, you dont have to have all those variables. If any are omitted, the defaults are set.

If you only pass 1 webskin name, then it is placed in the url.view attribute and the url.bodyView will be set to the default (displayBody)

  • No labels