RE: simple URLs like www.domain.com/go/2345

2005-04-09 Thread Steven Brownlee
Oh, well that answers the question (even though you already said it) that
you're using IIS.  The GetPageContext object will only return the original
request on Jrun or other J2EE server.  Try looking at the value of
CGI.QUERY_STRING.  What IIS does when it writes a custom response header is
take the original request and append it to the page you're redirecting to.
Here's an example.

You set the 404 handler to /go.cfm
You request http://www.domain.com/go/2345
IIS redirects to /go.cfm?404;http://www.domain.com/go/2345
Your CGI.QUERY_STRING will have a value of
?404;http://www.domain.com/go/2345
You can now do some simple RegEx or GetToken magic to grab the '2345' (e.g.
siteNumber = REFindNoCase("([:digit:]{4})$", cgi.query_string);)

Give those ideas a shot.

-Original Message-
From: Olivier [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 09, 2005 4:48 PM
To: CF-Talk
Subject: simple URLs like www.domain.com/go/2345

Ok, I got it to work. 
".cfm" was not associated in the ISAPI for this site ! :)

Now here is the go.cfm file
==
go:


#CGI.HTTP_REQUEST#

#GetPageContext().getRequest().getRequestURL().toString()#

#CGI.HTTP_REFERER#

#Now()#

==

But here are the result I get when going to http://go.mydomain.com/1234

==
go:


http://go.mydomain.com/go.cfm


{ts '2005-04-09 13:44:02'}
==

Neither the GetPageContext or HTTP_REQUEST are getting a value..
Help !! :)

Thanks.


~|
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:202133
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: simple URLs like www.domain.com/go/2345

2005-04-09 Thread Jared Rypka-Hauer - CMG, LLC
It may take a bit more work, but this solution is meant to work this
way, not make something work by breaking other things (all respect to
the 404-error afficianados out there, and no disrespect intended... I
just don't like fixing things by masking other broken things... it's a
matter of using things to their intended purpose).

Anyway, here's the URL, it's about using a combination of mod_rewrite
and mod_proxy to create masked URLs:
http://www.macromedia.com/devnet/mx/coldfusion/j2ee/articles/balancing_j2ee03.html

It works as well with CF as it does with Jrun, and it's all
practically the same thing anyway, you just have to read .cfm in a few
places and apply the concept to your problem. I set it up in a few
mintues one afternoon. The only real issue is tweaking your regexes so
your links don't end up broken... here's another bit of writing on the
subject:

http://blaine.korte.ca/index.cfm?mode=entry&entry=A8CFD94A-E18C-C9BC-0384EA187AF34613

Best'o'Luck...

Laterz!

J

On Apr 8, 2005 8:13 PM, olivier <[EMAIL PROTECTED]> wrote:
> Hello !
> 
> Basically, I want to be able to use a simple URL that would forward to a
> more complex one.
> Like when you communicate on paper, you don't want the user to have to type
> www.domain.com/products/index.cfm?action=this&product=that&disptype=1234&promo=1234
> but you'd rather have them use something simple like www.domain.com/1234
> 
> At the same time, you can take the opportunity to log that hit in another
> table to run statistics.
> 
> The question is: how do you handle with ColdFusion simple urls like that,
> that do not have a .cfm filename in the URL ?
> 
> Thanks so much !!! 


-- 
Continuum Media Group LLC
Burnsville, MN 55337
http://www.web-relevant.com
http://www.web-relevant.com/blogs/cfobjective

~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:202130
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: simple URLs like www.domain.com/go/2345

2005-04-09 Thread Steven Brownlee
Here's some sample code

originalRequest = GetPageContext().getRequest().getRequestURL().toString();
parse_sitename = GetToken(Replace(originalRequest,"//",""), 2, "/?&=;"); 


SELECT * from SITE where lower(FILEPATH) = '#lcase(parse_sitename)#'


-Original Message-
From: olivier [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 08, 2005 9:13 PM
To: CF-Talk
Subject: simple URLs like www.domain.com/go/2345

Hello !


Basically, I want to be able to use a simple URL that would forward to a
more complex one.
Like when you communicate on paper, you don't want the user to have to type
www.domain.com/products/index.cfm?action=this&product=that&disptype=1234&pro
mo=1234
but you'd rather have them use something simple like www.domain.com/1234

At the same time, you can take the opportunity to log that hit in another
table to run statistics.

The question is: how do you handle with ColdFusion simple urls like that,
that do not have a .cfm filename in the URL ?




Thanks so much !!! 


~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:202073
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


RE: simple URLs like www.domain.com/go/2345

2005-04-09 Thread Steven Brownlee
You configure your web server to create a custom 404 response header.  In
IIS, you go to the Custom Errors tab in the site properties and modify the
404 to point to a page on your site and perhaps add some custom URL
parameter to help you catch it.  Then on that page you parse the request
("CGI.HTTP_REQUEST" in CF5 or
"GetPageContext().getRequest().getRequestURL().toString()" in CF6/7) to grab
the token in the URL you're looking for.  You can then use that value to do
the lookup in your table.

-Original Message-
From: olivier [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 08, 2005 9:13 PM
To: CF-Talk
Subject: simple URLs like www.domain.com/go/2345

Hello !


Basically, I want to be able to use a simple URL that would forward to a
more complex one.
Like when you communicate on paper, you don't want the user to have to type
www.domain.com/products/index.cfm?action=this&product=that&disptype=1234&pro
mo=1234
but you'd rather have them use something simple like www.domain.com/1234

At the same time, you can take the opportunity to log that hit in another
table to run statistics.

The question is: how do you handle with ColdFusion simple urls like that,
that do not have a .cfm filename in the URL ?




Thanks so much !!! 


~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:202072
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: simple URLs like www.domain.com/go/2345

2005-04-09 Thread Bob Flynn
We did just this thing last year with the help of the good people on this list. 
If you contact me offline I'll be happy to share the code with you.

Bob

>Hello !
>
>
>Basically, I want to be able to use a simple URL that would forward to a 
>more complex one.
>Like when you communicate on paper, you don't want the user to have to type 
>www.domain.com/products/index.cfm?action=this&product=that&disptype=1234&promo=1234
> 
>but you'd rather have them use something simple like www.domain.com/1234
>
>At the same time, you can take the opportunity to log that hit in another 
>table to run statistics.
>
>The question is: how do you handle with ColdFusion simple urls like that, 
>that do not have a .cfm filename in the URL ?
>
>
>
>
>Thanks so much !!!

~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:202071
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


RE: simple URLs like www.domain.com/go/2345

2005-04-09 Thread James Holmes
One way is to use a 404 page that examines CGI.REQUEST_URI and matches the
links to those in a table somewhere (file, DB, whatever).
 
Another is Spikes FU servlet.
 
http://www.spike.org.uk/projects/fuservlet/
 

  _  

From: olivier
Sent: Sat 9/04/2005 9:13
To: CF-Talk
Subject: simple URLs like www.domain.com/go/2345



Hello ! 


Basically, I want to be able to use a simple URL that would forward to a 
more complex one. 
Like when you communicate on paper, you don't want the user to have to type 
www.domain.com/products/index.cfm?action=this&product=that&disptype=1234&pro
mo=1234 
but you'd rather have them use something simple like www.domain.com/1234 

At the same time, you can take the opportunity to log that hit in another 
table to run statistics. 

The question is: how do you handle with ColdFusion simple urls like that, 
that do not have a .cfm filename in the URL ? 




Thanks so much !!! 





~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:202069
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