A lot of websites do this for external links: /redirect.php?site_id=00021 What is the benefit of doing it this way, rather than just putting a direct link to the URL?
You can track clicks through your application. You can also block search engines from following those links. I think these are the 2 most common reasons for linking like this.
I see. So I suppose really the most useful function would be to count the hits, as you can always do a "rel=nofollow" on the link to prevent search engines following the link...
Another use is to obfuscate the target of the link - the user will see the "redirect.php" in the link when hovering (in the status bar of the browser) and will have no way of knowing where the link will take him if clicked. Personally I find this type of linking annoying, and there are other ways of counting clicks.
Right... it's the same principle as using tinyurl, or a similar service. And also like the other people mentioned, it can be useful for keeping track of traffic. This is useful for affiliate programs where you want to make sure you are getting credit for all the traffic you send.
The solution for keeping counting clicks and make users aware of where link goes to is to use format like: redirect.php?link=http://domain.com/page.html
There are no direct link for the google bots to parse while crawling - the link is only "triggered" when clicked, in the PHP-rewrite function - therefore, there is nothing else than the "/redirect.php?site_ID=000021" for the bots - they won't pick up on that link, and even if they do follow it, it won't build to the pagerank of the receiving site, since there is no direct link to the site from the original site. At least that's how I understand it.