I want to make each visited single page is first redirected to template.php page that has original targeted post permalink like AdFly shorten url service.
As for now it works using PHP header() Function. But I couldn`t figure out how to get original source page permalink to be included in template.php
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.yournewwebsite.com/template.php");
?>