Context: I am assembling a social networking kind of factor, and I wish to have the ability to validate any refresh or redirect with by pushing the consumer to a different script before reaching their destination..I figured about utilizing a 'get' method, but that will require me to by hand set each link like a form, either that or some type of ajax script however I'm not too acquainted with ajax to understand if that's altogether possible.

Can there be some type of apache rule I'm able to implement that is applicable a script to every redirect/refresh ?

Platform: I'm using php/mysql and am much less terrible at ajax/js

Why: I wish to have the ability to validate anyone's drenched in information aswell as track their page visits. (the second I am certain should be ajax related)

Any Ideas are welcome

You should use Javascript (or jQuery) to cycle through all of the links around the page and add an onClick attribute pointing to some handler function.

<a href="www.example.com/somepage.html" onClick="tracker(this);">Go Here</a>

You'll be able to define a custom tracker function

function tracker(link){
  // Pass data to some php page with AJAX
  // Return true for success (user will move to the selected page)
  // Return false to cancel the click (will do nothing)
}

To put it together using jQuery, it might look something similar to this:

$('a').each(function(index) {
  var attr = $(this).attr('onClick');
  if (typeof attr === 'undefined' || attr === false){
    $(this).attr('onClick', 'tracker(this);');
  }else{
    // onClick already set
  }
});

You can most likely use jQuery's native event functions to bind an onClick event too.

Incorporate a script on top of every page that check login information using periods (I really hope guess what happens I am saying) and when they aren't present, it redirects user to some login page. For the reason that same script, you may also track visit as you would like.