View Full Version : Wordpress and out.php

2nd October 2009, 08:37 AM
Hey everyone. I am posting in here to try to figure out how to integrate the out.php to all of my INTERNAL (ie. tube2k.com -> tube2k.com/704) links in my wordpress-based site. From what I understand, the way CJO measures productivity is by tracking all clicks on my site, and in order to do that, the out.php code has to be added to the beginning of all of my links. Can someone give me an explanation of how to actually get this done? I've been waiting for days now for a solution from my associates and they are coming up with nothing. Thank guys in advance for any help you're able to extend to me.

4th October 2009, 12:30 PM
Sorry for the late reply.

After talking with some mod_rewrite experts, you could try something like this:

RewriteRule ^(out)/([0-9]*)$ /out.php?pct=75&url=http://www.your-site.com/$2 [NC,L]

You will have to link to /out/123, where 123 corresponds to http://www.your-site.com/123

It may or may not work, depending on your other rewrite rules.

15th October 2009, 06:37 AM
So I am not totally understaning what you mean when you say I have to link to /out/123

And would it help if I posted the htaccess mod rewrite rules I currently have here for you so you can see if this new rule will conflict with any old ones?

ETA: I would have seen this reply sooner if I would have subscribed to the thread for email updates LOL sorry about that.

15th October 2009, 11:56 AM
The rewrite rule should be:

RewriteRule ^(out)/([0-9]*)$ /out.php?pct=75&url=http://www.your-site.com/$2 [NC,L]

On your site you link to http://www.your-site.com/123, that should be changed to http://www.your-site.com/out/123

15th October 2009, 06:02 PM
SO I will still need to change all of my urls on my site, to reflect /out/### then, correct? or does this new rule do that for me

15th October 2009, 06:07 PM
You need to change your links only. the rule will reflect the out/... change.

In any case, better test it before going production with it.

15th October 2009, 07:39 PM
Alrighty here's what I did. I added the new rule to htaccess and tried it out to see if it tracked prod, it didnt. I then went into my wp admin and changed the way the urls were written from /%post_id to /out/%post_id% and for every internal link I wanted this on on my site, it worked for tracking productivity but I got my custom 404 for every single cideo on the site. So... it works but it doesnt...