Re: Shorter URLs - How?
If you are bound, bent and determined to do this in CF simply have a url parser in your app.cfc. However this is really best left to URL rewriting via the webserver. On Tue, Sep 21, 2010 at 11:04 AM, Stefan Richter ste...@flashcomguru.comwrote: Hi all, I'm a Flex developer with just enough CF skills to be dangerous :-) and need some guidance here. My website allows users to access specific pages via a unique id/parameter such as this: http://www.scribblar.com/rooms/index.cfm?r=k3ns5 What's involved in terms of CF code to shorten this to http://www.scribblar.com/rooms/k3ns5 or even better still http://www.scribblar.com/k3ns5 I'm unsure as to how to achieve this. In case it makes a difference I am using a Windows box with IIS7. Cheers Stefan ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337265 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Shorter URLs - How?
The best approach for this would be to use a URL rewriting tool such as ISAPI_REWRITE. That's an IIS thing. Doing it with pure ColdFusion, the best thing you could hope for is http://www.scribblar.com/index.cfm/k3ns5 andy -Original Message- From: Stefan Richter [mailto:ste...@flashcomguru.com] Sent: Tuesday, September 21, 2010 10:04 AM To: cf-talk Subject: Shorter URLs - How? Hi all, I'm a Flex developer with just enough CF skills to be dangerous :-) and need some guidance here. My website allows users to access specific pages via a unique id/parameter such as this: http://www.scribblar.com/rooms/index.cfm?r=k3ns5 What's involved in terms of CF code to shorten this to http://www.scribblar.com/rooms/k3ns5 or even better still http://www.scribblar.com/k3ns5 I'm unsure as to how to achieve this. In case it makes a difference I am using a Windows box with IIS7. Cheers Stefan ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337266 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
Doing it with pure ColdFusion, the best thing you could hope for is http://www.scribblar.com/index.cfm/k3ns5 Untrue. I myself have written a cf based url rewrite before I knew how to do it via the webserver. He can achieve exactly what he wants by using IIS (or whatever) to point to a .cfm as the 404 handler and then having that cf page parse the url. It's not ideal but very doable. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337267 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
IIS7 has a built in url rewriter, so no need to isapi_rewriter. It works very similar to the mod_rewrite for apache in that the rewrite rules are store din a file within your website root called web.config, so it is portable between servers running IIS7+ If you want it to be portable betweeen any server\OS then you should do it in CFML. more info: http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/ Russ On Tue, Sep 21, 2010 at 4:32 PM, Michael Grant mgr...@modus.bz wrote: Doing it with pure ColdFusion, the best thing you could hope for is http://www.scribblar.com/index.cfm/k3ns5 Untrue. I myself have written a cf based url rewrite before I knew how to do it via the webserver. He can achieve exactly what he wants by using IIS (or whatever) to point to a .cfm as the 404 handler and then having that cf page parse the url. It's not ideal but very doable. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337268 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Shorter URLs - How?
With IIS 7, you can download the URL rewrite module for free from Microsoft. -Original Message- From: Andy Matthews [mailto:li...@commadelimited.com] Sent: Tuesday, September 21, 2010 8:22 AM To: cf-talk Subject: RE: Shorter URLs - How? The best approach for this would be to use a URL rewriting tool such as ISAPI_REWRITE. That's an IIS thing. Doing it with pure ColdFusion, the best thing you could hope for is http://www.scribblar.com/index.cfm/k3ns5 andy -Original Message- From: Stefan Richter [mailto:ste...@flashcomguru.com] Sent: Tuesday, September 21, 2010 10:04 AM To: cf-talk Subject: Shorter URLs - How? Hi all, I'm a Flex developer with just enough CF skills to be dangerous :-) and need some guidance here. My website allows users to access specific pages via a unique id/parameter such as this: http://www.scribblar.com/rooms/index.cfm?r=k3ns5 What's involved in terms of CF code to shorten this to http://www.scribblar.com/rooms/k3ns5 or even better still http://www.scribblar.com/k3ns5 I'm unsure as to how to achieve this. In case it makes a difference I am using a Windows box with IIS7. Cheers Stefan ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337269 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
Everybody else has given good advice, but I wanted to show you some code to do what you originally asked for. I searched for a small bit of code that Sean Corfield posted to his blog, and I can't find it. But he did add URL rewriting to his FW/1 framework. I'd wager it's close to the same code that he had separately posted earlier. You can download his framework and swipe the URL rewriting code: http://fw1.riaforge.org/ On Tue, Sep 21, 2010 at 9:04 AM, Stefan Richter ste...@flashcomguru.comwrote: Hi all, I'm a Flex developer with just enough CF skills to be dangerous :-) and need some guidance here. My website allows users to access specific pages via a unique id/parameter such as this: http://www.scribblar.com/rooms/index.cfm?r=k3ns5 What's involved in terms of CF code to shorten this to http://www.scribblar.com/rooms/k3ns5 or even better still http://www.scribblar.com/k3ns5 I'm unsure as to how to achieve this. In case it makes a difference I am using a Windows box with IIS7. Cheers Stefan ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337270 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
here also is a tutorials. http://tutorial557.easycfm.com/ On Tue, Sep 21, 2010 at 5:40 PM, Jacob Munson yacoub...@gmail.com wrote: Everybody else has given good advice, but I wanted to show you some code to do what you originally asked for. I searched for a small bit of code that Sean Corfield posted to his blog, and I can't find it. But he did add URL rewriting to his FW/1 framework. I'd wager it's close to the same code that he had separately posted earlier. You can download his framework and swipe the URL rewriting code: http://fw1.riaforge.org/ On Tue, Sep 21, 2010 at 9:04 AM, Stefan Richter ste...@flashcomguru.com wrote: Hi all, I'm a Flex developer with just enough CF skills to be dangerous :-) and need some guidance here. My website allows users to access specific pages via a unique id/parameter such as this: http://www.scribblar.com/rooms/index.cfm?r=k3ns5 What's involved in terms of CF code to shorten this to http://www.scribblar.com/rooms/k3ns5 or even better still http://www.scribblar.com/k3ns5 I'm unsure as to how to achieve this. In case it makes a difference I am using a Windows box with IIS7. Cheers Stefan ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337271 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
However this is really best left to URL rewriting via the webserver. I would also argue that it's not really bad to do URL rewriting within CF instead of in the web server. Sure, there may be high traffic situations where you're trimming miliseconds, but for most cases CF URL rewriting is a perfectly valid option. And many people would prefer to have all of their application configuration in one place, instead of needing to go to multiple places to maintain app level settings. Also, say you need to move the app to a different server or host. If you use web server URL rewriting, you'll need to set that up again on the new server. If you do it in CF you just need to drop your code on the server and your done. Personally I think it's a personal preference thing, not a This is the written in stone way that you should do it. :) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337273 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
Meh, the syntax is nearly identical between the different options. It would take anyone with half a brain all of about an hour to switch the rewrite rules over from apache to IIS or vice versa. Sure it's personal preference I guess but I generally try to use the right tool for the job. Data processing is best left to databases. URL rewriting is best left to the server. And ColdFusion server can be left to serve out ColdFusion pages. In a pinch you can use a pair of pantyhose to keep your alternator working. Then you go buy a serpentine belt the first chance you get. On Tue, Sep 21, 2010 at 1:07 PM, Jacob Munson yacoub...@gmail.com wrote: However this is really best left to URL rewriting via the webserver. I would also argue that it's not really bad to do URL rewriting within CF instead of in the web server. Sure, there may be high traffic situations where you're trimming miliseconds, but for most cases CF URL rewriting is a perfectly valid option. And many people would prefer to have all of their application configuration in one place, instead of needing to go to multiple places to maintain app level settings. Also, say you need to move the app to a different server or host. If you use web server URL rewriting, you'll need to set that up again on the new server. If you do it in CF you just need to drop your code on the server and your done. Personally I think it's a personal preference thing, not a This is the written in stone way that you should do it. :) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337275 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
Sure it's personal preference I guess but I generally try to use the right tool for the job. Data processing is best left to databases. URL rewriting is best left to the server. And ColdFusion server can be left to serve out ColdFusion pages. I won't disagree. I just think that there are cases where it makes sense to do URL rewriting in CF. And especially in this case, where we have a Flex developer that is learning CF...maybe it's not the best idea for him to go try to learn yet another technology when he can just use CF? Also, his app might be on a shared host which would make using web server URL rewriting difficult if not impossible. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337276 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
Assuming your pages are in a database-driven system, then the custom 404 is largely just an extension of ColdFusion serving pages: which page? dunno, lemme check the aliases, ah, there it is ... this page. Web server rewrite is fine, too, but if the code is already running in CF to determine what gets served, as it is in any front-side controller framework, then it's not much different to have a custom 404 as a simpler version of the controller. Just my 2c. From: Jacob Munson yacoub...@gmail.com Sent: Tuesday, September 21, 2010 2:48 PM To: cf-talk cf-talk@houseoffusion.com Subject: Re: Shorter URLs - How? Sure it's personal preference I guess but I generally try to use the right tool for the job. Data processing is best left to databases. URL rewriting is best left to the server. And ColdFusion server can be left to serve out ColdFusion pages. I won't disagree. I just think that there are cases where it makes sense to do URL rewriting in CF. And especially in this case, where we have a Flex developer that is learning CF...maybe it's not the best idea for him to go try to learn yet another technology when he can just use CF? Also, his app might be on a shared host which would make using web server URL rewriting difficult if not impossible. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337277 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
Not to argue, because you make good points, but just about every shared host I've ever used gives you a mechanism for url rewrite. In fact most offer really well documented steps on how to do it too. I think it's probably equally as hard for a new dev to understand url rewriting as it is to understand how to set up a custom 404 handler and then a url parser based off of the cgi scoped vars etc etc. Further I think you'd find that Google will return many many more walk throughs on web server url rewriting vs coldfusion rewriting. Six of one, half dozen of the other. I guess we'll just have to agree to disagree. On Tue, Sep 21, 2010 at 2:47 PM, Jacob Munson yacoub...@gmail.com wrote: Sure it's personal preference I guess but I generally try to use the right tool for the job. Data processing is best left to databases. URL rewriting is best left to the server. And ColdFusion server can be left to serve out ColdFusion pages. I won't disagree. I just think that there are cases where it makes sense to do URL rewriting in CF. And especially in this case, where we have a Flex developer that is learning CF...maybe it's not the best idea for him to go try to learn yet another technology when he can just use CF? Also, his app might be on a shared host which would make using web server URL rewriting difficult if not impossible. ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337278 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
I just think that there are cases where it makes sense to do URL rewriting in CF. Getting off topic, how does this affect SEO? What does googlebot or another search engine bot see when it's done this way? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337284 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
They see the rewritten URL. Sent with my Android phone On Sep 21, 2010 4:21 PM, Les Mizzell lesm...@bellsouth.net wrote: I just think that there are cases where it makes sense to do URL rewriting in CF. Getting off topic, how does this affect SEO? What does googlebot or another search engine bot see when it's done this way? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337287 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
If you are doing it in cf then that means you are using IIS (or *nix equiv) to return a cf page for processing when it determines the file is not there. If you do it right you return the proper response in the cfheader for the url (mydomain.com/tinyurl). If you don't do it right the spider gets the content of the url that it hit but gets 404 as the response from the server. That's bad. If you rewrite using the webserver you get the same result as the 'right' approach above. At least that's my understanding. On Tue, Sep 21, 2010 at 7:06 PM, Jacob Munson yacoub...@gmail.com wrote: They see the rewritten URL. Sent with my Android phone On Sep 21, 2010 4:21 PM, Les Mizzell lesm...@bellsouth.net wrote: I just think that there are cases where it makes sense to do URL rewriting in CF. Getting off topic, how does this affect SEO? What does googlebot or another search engine bot see when it's done this way? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337288 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
Well not to get to technical but cf actually sees the rewritten URL. The bots see the seo URL before it is rewritten Dan Baughman On Sep 21, 2010, at 5:06 PM, Jacob Munson yacoub...@gmail.com wrote: They see the rewritten URL. Sent with my Android phone On Sep 21, 2010 4:21 PM, Les Mizzell lesm...@bellsouth.net wrote: I just think that there are cases where it makes sense to do URL rewriting in CF. Getting off topic, how does this affect SEO? What does googlebot or another search engine bot see when it's done this way? ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337291 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Shorter URLs - How?
Well not to get to technical but cf actually sees the rewritten URL. The bots see the seo URL before it is rewritten You're right, I was thinking the wrong direction. :) ~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337292 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Shorter urls?
You could do something like the following. cfscript requestMap = CreateObject(java, java.util.HashMap); for(key in url) requestMap.put(URL| key, url[key]); uid = requestMap.hashCode(); /cfscript Matt Liotta President CEO Montara Software, Inc. http://www.montarasoftware.com/ 888-408-0900 x901 -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 1:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
RE: Shorter urls?
If you put a .cfm on the end, you can handle the request in the Application.cfm page. If you are using IIS, you have to tell it not to check to make sure the page exists. This is a setting specific to the application mapping. Or, you can use an ISAPI extension (IIS) or mod_rewrite (Apache) to rewrite the URL before it even gets to ColdFusion. There's a free one for IIS called ISAPI_Rewrite (http://www.isapirewrite.com). Benjamin S. Rogers http://www.c4.net/ v.508.240.0051 f.508.240.0057 -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 1:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: Shorter urls?
http://www.makeashorterlink.com is where you've probably seen it done. I'm not sure how they do it either though. -Kevin Graeme -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 12:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
RE: Shorter urls?
I think they make a database of urls and just use a randomly generated unique key to pull it out So you would have http://youurl?index.cfm?destination=#randomid# Robert Everland III Web Developer Extraordinaire Dixon Ticonderoga Company http://www.dixonusa.com -Original Message- From: Kevin Graeme [mailto:kgraeme;facstaff.wisc.edu] Sent: Tuesday, October 29, 2002 1:43 PM To: CF-Talk Subject: RE: Shorter urls? http://www.makeashorterlink.com is where you've probably seen it done. I'm not sure how they do it either though. -Kevin Graeme -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 12:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
Re: Shorter urls?
Thanks - I found the UDF I was looking for: http://www.cflib.org/udf.cfm?ID=212enable=1 On 10/29/02 10:39 AM, Benjamin S. Rogers [EMAIL PROTECTED] wrote: If you put a .cfm on the end, you can handle the request in the Application.cfm page. If you are using IIS, you have to tell it not to check to make sure the page exists. This is a setting specific to the application mapping. Or, you can use an ISAPI extension (IIS) or mod_rewrite (Apache) to rewrite the URL before it even gets to ColdFusion. There's a free one for IIS called ISAPI_Rewrite (http://www.isapirewrite.com). Benjamin S. Rogers http://www.c4.net/ v.508.240.0051 f.508.240.0057 -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 1:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: Shorter urls?
I have done this by using a lot of session and client variables, and a settings panel that a user can set defaults with, and if there happens to be an variables passed between pages, I store them in session vars. ..tony Tony Weeg Senior Web Developer Information System Design Navtrak, Inc. Fleet Management Solutions www.navtrak.net 410.548.2337 -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 1:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
RE: Shorter urls?
simple: 1. person submits link via form to make shorter... 2. you insert data into database 3. when inserting one field called maybe unique is a random generated alpha numberic string... randomize and compare to existing data to make sure no dupe exists already... 4. write the long URL and the unique string... 5. pass the shorter back to the user.. but first: A. create an index handler that shows form if no string found otherwise looks up table entries to find match ... pauses, displays notice and then pushes them out... that's how I plan on implementing mine when I find a few hours :) -paris Paris Lundis Founder Areaindex, L.L.C. http://www.areaindex.com http://www.pubcrawler.com 412-292-3135 [finding the future in the past, passing the future in the present] [connecting people, places and things] -Original Message- From: Kevin Graeme [EMAIL PROTECTED] Date: Tue, 29 Oct 2002 12:42:58 -0600 Subject: RE: Shorter urls? http://www.makeashorterlink.com is where you've probably seen it done. I'm not sure how they do it either though. -Kevin Graeme -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 12:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
RE: Shorter urls?
I don't believe encrypting the URL as this UDF does is the way to go. If I read it correctly, the order of the URL variables in the query string will affect the encrypted value. The code I posted in response to the original question does not suffer from this problem. Matt Liotta President CEO Montara Software, Inc. http://www.montarasoftware.com/ 888-408-0900 x901 -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 1:45 PM To: CF-Talk Subject: Re: Shorter urls? Thanks - I found the UDF I was looking for: http://www.cflib.org/udf.cfm?ID=212enable=1 On 10/29/02 10:39 AM, Benjamin S. Rogers [EMAIL PROTECTED] wrote: If you put a .cfm on the end, you can handle the request in the Application.cfm page. If you are using IIS, you have to tell it not to check to make sure the page exists. This is a setting specific to the application mapping. Or, you can use an ISAPI extension (IIS) or mod_rewrite (Apache) to rewrite the URL before it even gets to ColdFusion. There's a free one for IIS called ISAPI_Rewrite (http://www.isapirewrite.com). Benjamin S. Rogers http://www.c4.net/ v.508.240.0051 f.508.240.0057 -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 1:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
RE: Shorter urls?
Once upon a time, someone on this list described a process where they created a CFML page from IIS's 404 error page (404.html becomes 404.cfm) that pre-processes all incoming page requests. Basically, the IIS document root is completely empty and everything gets preprocessed by the 404 error file. Files get included from a CF document root to generate the actual user output. This seems like a pretty darn ingenious way to do a bunch of cool stuff! If the person who told me about this is out there, I apologize for forgetting your name! Regards, Kevin -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 12:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
Re: Shorter urls?
You're right - I just tested it. On 10/29/02 10:52 AM, Matt Liotta [EMAIL PROTECTED] wrote: I don't believe encrypting the URL as this UDF does is the way to go. If I read it correctly, the order of the URL variables in the query string will affect the encrypted value. The code I posted in response to the original question does not suffer from this problem. Matt Liotta President CEO Montara Software, Inc. http://www.montarasoftware.com/ 888-408-0900 x901 -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 1:45 PM To: CF-Talk Subject: Re: Shorter urls? Thanks - I found the UDF I was looking for: http://www.cflib.org/udf.cfm?ID=212enable=1 On 10/29/02 10:39 AM, Benjamin S. Rogers [EMAIL PROTECTED] wrote: If you put a .cfm on the end, you can handle the request in the Application.cfm page. If you are using IIS, you have to tell it not to check to make sure the page exists. This is a setting specific to the application mapping. Or, you can use an ISAPI extension (IIS) or mod_rewrite (Apache) to rewrite the URL before it even gets to ColdFusion. There's a free one for IIS called ISAPI_Rewrite (http://www.isapirewrite.com). Benjamin S. Rogers http://www.c4.net/ v.508.240.0051 f.508.240.0057 -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 1:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
RE: Shorter urls?
its a simple problem we have something similar at shortlinks.stubhub.com just a table with the url you want, an id, and some stats... -Shawn -Original Message- From: Kevin Graeme [mailto:kgraeme;facstaff.wisc.edu] Sent: Tuesday, October 29, 2002 10:43 AM To: CF-Talk Subject: RE: Shorter urls? http://www.makeashorterlink.com is where you've probably seen it done. I'm not sure how they do it either though. -Kevin Graeme -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 12:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: Shorter urls?
Yeah, That UDF makes longer URLs. That reminds me I need to send Ray an update for that one. Tim -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 2:02 PM To: CF-Talk Subject: Re: Shorter urls? You're right - I just tested it. On 10/29/02 10:52 AM, Matt Liotta [EMAIL PROTECTED] wrote: I don't believe encrypting the URL as this UDF does is the way to go. If I read it correctly, the order of the URL variables in the query string will affect the encrypted value. The code I posted in response to the original question does not suffer from this problem. Matt Liotta President CEO Montara Software, Inc. http://www.montarasoftware.com/ 888-408-0900 x901 -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 1:45 PM To: CF-Talk Subject: Re: Shorter urls? Thanks - I found the UDF I was looking for: http://www.cflib.org/udf.cfm?ID=212enable=1 On 10/29/02 10:39 AM, Benjamin S. Rogers [EMAIL PROTECTED] wrote: If you put a .cfm on the end, you can handle the request in the Application.cfm page. If you are using IIS, you have to tell it not to check to make sure the page exists. This is a setting specific to the application mapping. Or, you can use an ISAPI extension (IIS) or mod_rewrite (Apache) to rewrite the URL before it even gets to ColdFusion. There's a free one for IIS called ISAPI_Rewrite (http://www.isapirewrite.com). Benjamin S. Rogers http://www.c4.net/ v.508.240.0051 f.508.240.0057 -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 1:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing ? http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
RE: Shorter urls?
Again, if you simply store the URL as a string in your database then the order of the URL variables matter. Matt Liotta President CEO Montara Software, Inc. http://www.montarasoftware.com/ 888-408-0900 x901 -Original Message- From: Shawn Kernes [mailto:skernes;liquidseats.com] Sent: Tuesday, October 29, 2002 2:07 PM To: CF-Talk Subject: RE: Shorter urls? its a simple problem we have something similar at shortlinks.stubhub.com just a table with the url you want, an id, and some stats... -Shawn -Original Message- From: Kevin Graeme [mailto:kgraeme;facstaff.wisc.edu] Sent: Tuesday, October 29, 2002 10:43 AM To: CF-Talk Subject: RE: Shorter urls? http://www.makeashorterlink.com is where you've probably seen it done. I'm not sure how they do it either though. -Kevin Graeme -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 12:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com
RE: Shorter urls?
Yeah, we were just doing basically the same thing for a different project, and I thought of it just after I sent my email saying I didn't know how they did it. I need a nap after lunch. -Kevin -Original Message- From: Paris Lundis [mailto:PLundis;areaindex.com] Sent: Tuesday, October 29, 2002 12:52 PM To: CF-Talk Subject: RE: Shorter urls? simple: 1. person submits link via form to make shorter... 2. you insert data into database 3. when inserting one field called maybe unique is a random generated alpha numberic string... randomize and compare to existing data to make sure no dupe exists already... 4. write the long URL and the unique string... 5. pass the shorter back to the user.. but first: A. create an index handler that shows form if no string found otherwise looks up table entries to find match ... pauses, displays notice and then pushes them out... that's how I plan on implementing mine when I find a few hours :) -paris Paris Lundis Founder Areaindex, L.L.C. http://www.areaindex.com http://www.pubcrawler.com 412-292-3135 [finding the future in the past, passing the future in the present] [connecting people, places and things] -Original Message- From: Kevin Graeme [EMAIL PROTECTED] Date: Tue, 29 Oct 2002 12:42:58 -0600 Subject: RE: Shorter urls? http://www.makeashorterlink.com is where you've probably seen it done. I'm not sure how they do it either though. -Kevin Graeme -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 12:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
RE: Shorter urls?
Kev, I have some logic that grabs errors in that way and it also analyzes stuff to see if people are trying to post to pages :) Under IIS you can configure your 404 errors to point toward anything... That's an easy way... -What are you trying to achieve and I can/will share more... Paris Lundis Founder Areaindex, L.L.C. http://www.areaindex.com http://www.pubcrawler.com 412-292-3135 [finding the future in the past, passing the future in the present] [connecting people, places and things] -Original Message- From: Miller, Kevin [EMAIL PROTECTED] Date: Tue, 29 Oct 2002 10:56:40 -0800 Subject: RE: Shorter urls? Once upon a time, someone on this list described a process where they created a CFML page from IIS's 404 error page (404.html becomes 404.cfm) that pre-processes all incoming page requests. Basically, the IIS document root is completely empty and everything gets preprocessed by the 404 error file. Files get included from a CF document root to generate the actual user output. This seems like a pretty darn ingenious way to do a bunch of cool stuff! If the person who told me about this is out there, I apologize for forgetting your name! Regards, Kevin -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 12:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
Re: Shorter urls?
I agree Matt. The way the example site does this is through a random string creater witha database... its based logic in their default document.. I suspect index.php... they even use the dreaded ? mark which is the giveaway as to how part of it is functioning Paris Lundis Founder Areaindex, L.L.C. http://www.areaindex.com http://www.pubcrawler.com 412-292-3135 [finding the future in the past, passing the future in the present] [connecting people, places and things] -Original Message- From: Ian Lurie [EMAIL PROTECTED] Date: Tue, 29 Oct 2002 11:02:25 -0800 Subject: Re: Shorter urls? You're right - I just tested it. On 10/29/02 10:52 AM, Matt Liotta [EMAIL PROTECTED] wrote: I don't believe encrypting the URL as this UDF does is the way to go. If I read it correctly, the order of the URL variables in the query string will affect the encrypted value. The code I posted in response to the original question does not suffer from this problem. Matt Liotta President CEO Montara Software, Inc. http://www.montarasoftware.com/ 888-408-0900 x901 -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 1:45 PM To: CF-Talk Subject: Re: Shorter urls? Thanks - I found the UDF I was looking for: http://www.cflib.org/udf.cfm?ID=212enable=1 On 10/29/02 10:39 AM, Benjamin S. Rogers [EMAIL PROTECTED] wrote: If you put a .cfm on the end, you can handle the request in the Application.cfm page. If you are using IIS, you have to tell it not to check to make sure the page exists. This is a setting specific to the application mapping. Or, you can use an ISAPI extension (IIS) or mod_rewrite (Apache) to rewrite the URL before it even gets to ColdFusion. There's a free one for IIS called ISAPI_Rewrite (http://www.isapirewrite.com). Benjamin S. Rogers http://www.c4.net/ v.508.240.0051 f.508.240.0057 -Original Message- From: Ian Lurie [mailto:ian;portentinteractive.com] Sent: Tuesday, October 29, 2002 1:27 PM To: CF-Talk Subject: Shorter urls? Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
Re: Shorter urls?
You can create your parameters as a list or string and pass them as a single query string: http://www.site.com?detail,108,492 then use the list or the string to generate your variables for a a redirect: cflocation url=index.cfm?fuseaction=#listfirst(cgi.query_string)#catid=#l istgetat(cgi.query_string,2)#productid=#listgetat(cgi.query_string)# Essentially, url-shorteners always work by condensing the url parameters and removing the varname= portions of the query string and parsing the data manually. I've seen at least one web-site that offers a url-shortening service as an asp where you provide a long url and they enter it into a db and provide you with something like http://shorturl.com?3596 ... Which could always be done internally... Isaac Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
RE: Shorter urls?
It should just be noted that this can be a HUGE security risk. Anyone who wants to could then type in http://shorturl.com/?12345 and potentially see data they're not supposed to see. Just make sure you have other security checks in place. -- Mosh Teitelbaum evoch, LLC Tel: (301) 625-9191 Fax: (301) 933-3651 Email: [EMAIL PROTECTED] WWW: http://www.evoch.com/ -Original Message- From: S. Isaac Dealey [mailto:info;turnkey.to] Sent: Tuesday, October 29, 2002 2:20 PM To: CF-Talk Subject: Re: Shorter urls? You can create your parameters as a list or string and pass them as a single query string: http://www.site.com?detail,108,492 then use the list or the string to generate your variables for a a redirect: cflocation url=index.cfm?fuseaction=#listfirst(cgi.query_string)#catid=#l istgetat(cgi.query_string,2)#productid=#listgetat(cgi.query_string)# Essentially, url-shorteners always work by condensing the url parameters and removing the varname= portions of the query string and parsing the data manually. I've seen at least one web-site that offers a url-shortening service as an asp where you provide a long url and they enter it into a db and provide you with something like http://shorturl.com?3596 ... Which could always be done internally... Isaac Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm
RE: Shorter urls?
I rather assumed the caveat of the short url not being related to security... That is -- all the normal rules of security apply, and the short url does not _help_ you secure the site -- it actually doesn't really hurt in any way either, because if the short url can get someone to a place they're not supposed to be, then there is by definition, a pre-existing security error that should be fixed. Security itself should always be as close to the secured data / resources as possible. If the secured data is an individual page, security should ensure that nobody who's unauthorized for that page sees that page from that page, not for instance by removing links from other pages. This is a reasonably common mistake -- people try to secure a page by removing a link from other page(s) and someone who at one point was authorized to see the page, but is no longer authorized can still get access to it regardless by using a bookmark or typing in a url they remember. Isaac Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 It should just be noted that this can be a HUGE security risk. Anyone who wants to could then type in http://shorturl.com/?12345 and potentially see data they're not supposed to see. Just make sure you have other security checks in place. -- Mosh Teitelbaum evoch, LLC Tel: (301) 625-9191 Fax: (301) 933-3651 Email: [EMAIL PROTECTED] WWW: http://www.evoch.com/ -Original Message- From: S. Isaac Dealey [mailto:info;turnkey.to] Sent: Tuesday, October 29, 2002 2:20 PM To: CF-Talk Subject: Re: Shorter urls? You can create your parameters as a list or string and pass them as a single query string: http://www.site.com?detail,108,492 then use the list or the string to generate your variables for a a redirect: cflocation url=index.cfm?fuseaction=#listfirst(cgi.query_string)#c atid=#l istgetat(cgi.query_string,2)#productid=#listgetat(cgi.qu ery_string)# Essentially, url-shorteners always work by condensing the url parameters and removing the varname= portions of the query string and parsing the data manually. I've seen at least one web-site that offers a url-shortening service as an asp where you provide a long url and they enter it into a db and provide you with something like http://shorturl.com?3596 ... Which could always be done internally... Isaac Certified Advanced ColdFusion 5 Developer www.turnkey.to 954-776-0046 Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah;. ... And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Portent Interactive Effective web sites through Conversation Marketing http://www.portentinteractive.com ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
Re: Shorter urls?
Here's an interesting solution. It's not perfect (just threw the code together), but it works. It has the additional benefit of adding a level of security to your application because it hashes your query string in a way that cannot be reversed (essentially obfuscates it in a non-reversible manner). It also assumes that once you have created a shorter query string, you will eventually want to recover the original query string, probably in the page processing the request that contains the query string. Start by including these two functions: cfscript function getShortString(str) { var key = ; if (false is isDefined(application._strMap)) { application._strMap = structNew(); } key = hash(str); application._strMap[key] = str; return key; } function getLongString(key) { if (false is isDefined(application._strMap)) { return ; } if (false is structKeyExists(application._strMap, key)) { return ; } return application._strMap[key]; } /cfscript Then create your querystrings like this: cfset qs = a=bb=cc=a / a href=someProcessingPage.cfm?q=cfoutput#getShortString(qs)#/cfoutputclick here/a In the processing page, retrieve the original querystring like this: cfset qs = #getLongString(url.q)# / The full querystring is cfoutput#qs#/cfoutput. Of course, you could do something a little more clever like creating a function that returns a struct or parses the querystring and puts the values in the URL scope so that you could retrieve them just as though they were literally passed in the URL as opposed to actually getting back a query string, but you get the idea. Your query string has to be over 32 characters before this technique starts to pay for itself in terms of length since the hash() function returns a 32 byte string. As I mentioned earlier, it has the added benefit of completely obscruing the data you pass in your query string, too, since the MD5 hash is not reversable. If you decide to implement something like this, consider variable locking. Hope this helps. Cantrell Ian Lurie wrote: Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Christian Cantrell [EMAIL PROTECTED] (571) 220-8659 (mobile) ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm
RE: Shorter urls?
This technique seems like a waste of processing time when the underlying Java object already provides the same thing. From the documentation... hashCode public int hashCode() Returns the hash code value for this map. The hash code of a map is defined to be the sum of the hash codes of each entry in the map's entrySet() view. This ensures that t1.equals(t2) implies that t1.hashCode()==t2.hashCode() for any two maps t1 and t2, as required by the general contract of Object.hashCode. This implementation iterates over entrySet(), calling hashCode on each element (entry) in the Collection, and adding up the results. See my earlier response to the question for an example of using the hashCode method with a Map. Matt Liotta President CEO Montara Software, Inc. http://www.montarasoftware.com/ 888-408-0900 x901 -Original Message- From: Christian Cantrell [mailto:qantrell;yahoo.com] Sent: Tuesday, October 29, 2002 10:08 PM To: CF-Talk Subject: Re: Shorter urls? Here's an interesting solution. It's not perfect (just threw the code together), but it works. It has the additional benefit of adding a level of security to your application because it hashes your query string in a way that cannot be reversed (essentially obfuscates it in a non-reversible manner). It also assumes that once you have created a shorter query string, you will eventually want to recover the original query string, probably in the page processing the request that contains the query string. Start by including these two functions: cfscript function getShortString(str) { var key = ; if (false is isDefined(application._strMap)) { application._strMap = structNew(); } key = hash(str); application._strMap[key] = str; return key; } function getLongString(key) { if (false is isDefined(application._strMap)) { return ; } if (false is structKeyExists(application._strMap, key)) { return ; } return application._strMap[key]; } /cfscript Then create your querystrings like this: cfset qs = a=bb=cc=a / a href=someProcessingPage.cfm?q=cfoutput#getShortString(qs)#/cfoutput click here/a In the processing page, retrieve the original querystring like this: cfset qs = #getLongString(url.q)# / The full querystring is cfoutput#qs#/cfoutput. Of course, you could do something a little more clever like creating a function that returns a struct or parses the querystring and puts the values in the URL scope so that you could retrieve them just as though they were literally passed in the URL as opposed to actually getting back a query string, but you get the idea. Your query string has to be over 32 characters before this technique starts to pay for itself in terms of length since the hash() function returns a 32 byte string. As I mentioned earlier, it has the added benefit of completely obscruing the data you pass in your query string, too, since the MD5 hash is not reversable. If you decide to implement something like this, consider variable locking. Hope this helps. Cantrell Ian Lurie wrote: Hi all, I've searched the devcenter, google, etc. but can't seem to find any discussion of how to generate shorter URL strings. I want to take: http://www.site.com?action=blahbrand=1name=blahblah; And convert it to http://www.site.com/asdfwer234123 I've seen it done but just can't remember where. Can someone send me a url? Thanks in advance, Ian -- Christian Cantrell [EMAIL PROTECTED] (571) 220-8659 (mobile) ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.
Re: Shorter urls?
You could very well replace the implementation of the getShortString function below with code which calls hashCode() on a HashMap containing your name/value pairs, and in fact, I think it is an excellent approach. I only opted for the hash() function in my own implementation for the following reasons: 1. In general, calling hashCode on two distinct object instances is not actually guaranteed to return a unique number for each object instance. From the documentation: It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables. Since we are only talking about strings here, and hopefully all implementations of Java return unique integers for unique strings (though they are not technically required to), this is really a non-issue. My gut reaction, though, is not to trust hashCode to always return a unique number. 2. Since calling hashCode() on a HashMap returns the sum of all its entries' hash codes, isn't it possible (though unlikely) that the following statement could be true? a.hashCode() + b.hashCode() == c.hashCode() 3. Hash codes are not guaranteed to be consistent from one execution of a Java application to the next. From the documentation: Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. In other words, if you had to restart your server, or if you were load balancing between multiple CF servers (especially if they were running different versions or implementations of Java), your hash codes could technically end up being inconsistent. The implementation I provided would need to store the struct of hashes and values persistently in order to avoid this issue, but I believe in the end, your hashes would be consistent. These are really very small points which are very unlikely to occur, so in general, I agree with Matt that his implementation is a good approach. And I also agree with him that calculating a hash code should be (though is not guaranteed to be) less processor-intensive than the MD5 algorithm. I only meant to suggest an alternative. Cantrell Matt Liotta wrote: This technique seems like a waste of processing time when the underlying Java object already provides the same thing. From the documentation... hashCode public int hashCode() Returns the hash code value for this map. The hash code of a map is defined to be the sum of the hash codes of each entry in the map's entrySet() view. This ensures that t1.equals(t2) implies that t1.hashCode()==t2.hashCode() for any two maps t1 and t2, as required by the general contract of Object.hashCode. This implementation iterates over entrySet(), calling hashCode on each element (entry) in the Collection, and adding up the results. See my earlier response to the question for an example of using the hashCode method with a Map. Matt Liotta President CEO Montara Software, Inc. http://www.montarasoftware.com/ 888-408-0900 x901 -Original Message- From: Christian Cantrell [mailto:qantrell;yahoo.com] Sent: Tuesday, October 29, 2002 10:08 PM To: CF-Talk Subject: Re: Shorter urls? Here's an interesting solution. It's not perfect (just threw the code together), but it works. It has the additional benefit of adding a level of security to your application because it hashes your query string in a way that cannot be reversed (essentially obfuscates it in a non-reversible manner). It also assumes that once you have created a shorter query string, you will eventually want to recover the original query string, probably in the page processing the request that contains the query string. Start by including these two functions: cfscript function getShortString(str) { var key = ; if (false is isDefined(application._strMap)) { application._strMap = structNew(); } key = hash(str); application._strMap[key] = str; return key; } function getLongString(key) { if (false is isDefined(application._strMap)) { return ; } if (false is structKeyExists(application._strMap, key)) { return ; } return application._strMap[key]; } /cfscript Then create your querystrings like this: cfset qs = a=bb=cc=a / a href=someProcessingPage.cfm?q=cfoutput#getShortString(qs)#/cfoutput click here/a In the processing page, retrieve the original