This is pretty much exactly what I designed the FriendlyURLServlet to do.

I'm in the middle of adding some functionality to that to allow you to 
specify a redirectHandler in web.xml that will cause all requests that 
match the servlet mapping to be passed directly to the handler.

so if you had a URL like this:

http://www.houseoffusion.com/cf_lists/messages_4_38946.cfm

and your web.xml looked something like this:

<servlet>
     <servlet-name>FUServlet</servlet-name>
     <display-name>FriendlyUrlServlet</display-name>
     <description>Translates friendly URLs to objects</description>
     <servlet-class>FriendlyURLServlet</servlet-class>
     <init-param>
        <param-name>redirectHandler</param-name>
        <param-value>/go.cfm</param-value>
     </init-param>
   </servlet>

   <servlet-mapping>
     <servlet-name>FUServlet</servlet-name>
     <url-pattern>/cf_lists/*</url-pattern>
     <is-default>false</is-default>
   </servlet-mapping>

/go.cfm would get the request with an extra URL variable called path. 
The value of that variable would be "/cf_lists/messages_4_38946.cfm"

How you handle the processing of that variable and any subsequent 
redirection is entirely up to you.

Spike

Michael Dinowitz wrote:
> I think I'm not making myself clear here. I'm speaking about a CF based url
> rewriter, not a generic 404 catcher. If an url is written in a specific
> manner (messages_4_33432) then it'll translate into a valid and expected
> page. This is designed as a way to format specific pages that normally would
> need url/form variables into static looking pages. 
> For example, a user or bot sees:
> http://www.houseoffusion.com/cf_lists/messages_4_38946.cfm
> This is a valid url and any attempt to visit it will result in a valid
> document. Behind the scenes this may be something other than a file named
> messages_4_38946.cfm but that does not matter to the visitor. All they care
> about is a link and a result.
>  
> 
>>I done it ages ago, and I found it is not how the web is supposed to work,
>>a
>>404 error means page not found (as we all know) and that's what it should
>>be
>>used for, there are all kinds of ramifications when you use it for
>>something
>>else, for example; search engines will not pick your page up, fine if you
>>don't want them listed in the first place. I think you are also opening
>>yourself up for a security attack (not sure about the specifics anymore).
>>
>>Just my dos pesetas
>>
> 
> 
> 
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:198750
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to