Skip to main content
Inspiring
May 1, 2007
Question

Custom 404 for 1 folder

  • May 1, 2007
  • 3 replies
  • 352 views
I have a customer who wants to track clicks on certain links in his own way. Basically he wants to mask where the link is really sending a person by going to his "special" folder on his site, counting the click, and then sending them on to the real site. It is affliate marketing and he is paranoid that people will bypass him if he doesn't mask the link to make it look like a normal link and not an affiliate link.

So he wants a link like http://www.hissite.com/dummyfolder/widgets.cfm but there is no widgets.cfm file. He wants it caught, parsed for the widgets, incident recorded in db, and then passed onto the affiliate site.

What I was thinking was have an application.cfc (or cfm) template that does everything since it is supposed to be executed before any other template but then I realized that there has to be a page in there or it doesn't process. Soooooo I'm looking at how to capture a 404 JUST in that folder and put everything in that template.

Any other ideas on how to do this?
This topic has been closed for replies.

3 replies

Inspiring
May 2, 2007
Would he be okay using Search Engine Safe URL's (SES's)?

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=2addd247
Inspiring
May 2, 2007
We use something like this setup:

Your Link:
http://www.hissite.com/redirect.cfm?product=5&loc=[url encoded URL]

You could use javascript:widow.status='some link text' to mask the link destination in the status bar

redirect.cfm:
---------------------------
1) Log link click
2) forward on to URL

You may want to consider adding some sort of token to make sure no one else uses the script as an open HTTP relay. You could use Encrypt() to base64 / HEX encrypt the data to make it really secure.
Inspiring
May 2, 2007
I don't think I'm making myself clear. He wants NO question marks in the URL.

The one he pointed me to was tinyurl.com I'm not sure how they do this but your link will look like this http://www.tinyurl.com/something

This then does a redirect to the proper site. So the only thing I can figure is it has a custom 404 page that catches it, reads the "something" part of it, and then sends the request on.
Inspiring
May 2, 2007

how about making an actual widgets.cfm page that does all that?

--
Azadi Saryev
Sabai-dee.com
Vientiane, Laos
http://www.sabai-dee.com
Inspiring
May 2, 2007
Okay. This is affiliate marketing. So he doesn't want to have to build a new page for each product he sells. Instead he wants the site to figure out what affiliate product was clicked on and then record it and redirect it.