AmigoJack wrote: ↑Mon Jun 11, 2018 7:33 am
Don't do that - you hand over every URI to a third party, which can easily log everything everyone links. And on top of that when the service dies you're sitting there with dead links.
This is a local script and the redirection is performed locally, see the link.
@OP Similar to AmigoJacks's warning one thing to keep in mind is you need to maintain this forever.
If I was going to implement something like this I'd just put it at the bottom of viewtopic.php, viewforum.php and perhaps downloads/file.php
Use validated phpBB variables, if in viewtopic.php this should work.
Code: Select all
$shortenedurl = file_get_contents('http://yourdomain.com/shorten.php?longurl=' . urlencode('http://yourdomian.com/viewtopic.php?f=' . $forum_id . '&t=' . $topic_id . ($start ? '&start=' . $start : '')));
As far as the security of the third party script I'm no expert but I see it will block based on IP and I would be sure to use that.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”
Attributed - Thomas Edison