Hey Tom, look good but cflocation will change the URL.

Thanks


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Tom Woestman
Sent: Monday, January 24, 2005 1:40 PM
To: [email protected]
Subject: RE: Web Server Redirect On File Extension


Daniel,

Following is some code we use in an application.cfm to do what you wanted.
Basically, if the file requested is not one of
(index.cfm,404.cfm,keepAlive.cfm) then the browser is redirect as noted in
the cflocation tag.

The code is somewhat complex to ensure that people cannot bypass our check
by including the 'index.cfm' just anywhere in the URL but that it must be
the last file listed.

Hope you find this useful,
Tom



<cfif LEN(CGI.SCRIPT_NAME) and (

ListFindNoCase("index.cfm,404.cfm,keepAlive.cfm",ListLast(CGI.SCRIPT_NAME,"/
")) eq 0
        or not
        (
                (
ListFindNoCase("index.cfm,404.cfm,keepAlive.cfm",ListLast(CGI.SCRIPT_NAME,"/
")) gt 0 and
                        listLen(CGI.SCRIPT_NAME,"/") eq 1
                )
                or
                (
ListFindNoCase("index.cfm,404.cfm,keepAlive.cfm",ListLast(CGI.SCRIPT_NAME,"/
")) gt 0 and
                        listLen(CGI.SCRIPT_NAME,"/") eq 2 and
                        allowedFolderFound
                )
        )
)>
        <cflocation url="#Request.WebRoot#/index.cfm?fa=badaccess"
addtoken="no">
</cfif>



-----Original Message-----
From: Daniel Elmore [mailto:[EMAIL PROTECTED]
Sent: Monday, January 24, 2005 11:23 AM
To: [email protected]
Subject: Web Server Redirect On File Extension

I need to redirect all requests for .cfml files to one particular .cfm file.
When the user goes to www.mysite.com/test.cfml  the url should not change
but should instead load cfml_files.cfm. (I guess this isn't a true redirect
but more of wildcard include). I am not using apache but IIS, I know that
would have make this easier. Is there a way to do this in CFMX's xml
configuration files?

Thanks!
Daniel Elmore


----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe:
   http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe:
   http://www.dfwcfug.org/form_MemberRegistration.cfm


----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe:
   http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe:
   http://www.dfwcfug.org/form_MemberRegistration.cfm





----------------------------------------------------------
To post, send email to [email protected]
To unsubscribe: 
   http://www.dfwcfug.org/form_MemberUnsubscribe.cfm
To subscribe: 
   http://www.dfwcfug.org/form_MemberRegistration.cfm


Reply via email to