We use the ALIAS field for this (we dont use the default FarCry Friendly URLs because our titles are quite descriptive and actually make for an UN-friendly URL).
(I believe) we trap the "page not found" error and see if an alias exists for the "missing" page and then re-direct to the appropriate FarCry GUID.
I'll drop the code in here (but it is specific to our environment and our internal IP addresses - and how we have our servers set up). Just drop it into a "notfound.cfm" (or whatever name suits) and make this the CF script that handles not found errors on your site. We handle the /go option for historic reasons (so you could possibly leave this out if no such facility previously existed).
Oh - and you also need to create a "Resource Not Found" page for this to all work.
<CFSET conjurer = application.url.conjurer>
<CFIF Find('10.10.30.',cgi.http_host)>
<CFSET conjurer = "http://" & cgi.http_host & "/index.cfm">
</CFIF>
<CFIF REFindNoCase(":80/go/",cgi.query_string)>
<CFSET navid = ListLast(cgi.query_string,"/")>
<CFIF navid eq "">
<CFLOCATION url="" addtoken="no">
<CFELSE>
<CFIF StructKeyExists(Application.navid,navid) and bNavidAllowed(navid)>
<CFSET navobjid = application.navid[navid]>
<CFLOCATION url="" addtoken="no">
<CFELSE>
<CFLOCATION url="" addtoken="no">
</CFIF>
</CFIF>
<CFELSEIF REFind(":80/",cgi.query_string )>
<CFSET navid = ListLast(cgi.query_string,"/")>
<CFIF navid eq "">
<CFLOCATION url="" addtoken="no">
<CFELSE>
<CFIF StructKeyExists( Application.navid,navid) and bNavidAllowed(navid)>
<CFSET navobjid = application.navid[navid]>
<CFLOCATION url="" addtoken="no">
<CFELSE>
<CFLOCATION url="" addtoken="no">
</CFIF>
</CFIF>
<CFELSE>
<CFLOCATION url="" addtoken="no">
</CFIF>
<CFIF Find('10.10.30.',cgi.http_host)>
<CFSET conjurer = "http://" & cgi.http_host & "/index.cfm">
</CFIF>
<CFIF REFindNoCase(":80/go/",cgi.query_string)>
<CFSET navid = ListLast(cgi.query_string,"/")>
<CFIF navid eq "">
<CFLOCATION url="" addtoken="no">
<CFELSE>
<CFIF StructKeyExists(Application.navid,navid) and bNavidAllowed(navid)>
<CFSET navobjid = application.navid[navid]>
<CFLOCATION url="" addtoken="no">
<CFELSE>
<CFLOCATION url="" addtoken="no">
</CFIF>
</CFIF>
<CFELSEIF REFind(":80/",cgi.query_string )>
<CFSET navid = ListLast(cgi.query_string,"/")>
<CFIF navid eq "">
<CFLOCATION url="" addtoken="no">
<CFELSE>
<CFIF StructKeyExists( Application.navid,navid) and bNavidAllowed(navid)>
<CFSET navobjid = application.navid[navid]>
<CFLOCATION url="" addtoken="no">
<CFELSE>
<CFLOCATION url="" addtoken="no">
</CFIF>
</CFIF>
<CFELSE>
<CFLOCATION url="" addtoken="no">
</CFIF>
<CFSCRIPT>
function bNavidAllowed(navid)
{
var bRet = true;
if (ListFindNoCase('root',navid))
{
bRet = false;
}
return bRet;
}
</CFSCRIPT>
Regards,
Gary Menzel
On 7/21/05, Tom Barr <[EMAIL PROTECTED]> wrote:
We have had a number of requests from Marketing and other department to
create what they call friendly URL's. These are not the Search Engine Safe
URL's that Friendly URL's normally are. They are looking for something
like www.foo.com/tvoffer.
I can accomodate them the old fashion way and manually create directories
with index.cfm redirecting to the right object id but that would get messy
after a while.
I could use FarCry plug in Friendly URL's but they won't be happy with
http://ourintranet/go/human-resources/faq's/annual-benefits-statement when
announcing exciting new benefits.
I could write a little CF code to create a directory and an index.cfm
using their friendly term and the proper objectid.
Is there a way to do this cleanly in FarCry? Create a custom type and have
application.cfm catch and redirect??
---
You are currently subscribed to farcry-dev as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/
--- You are currently subscribed to farcry-dev as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
