Forum Moderators: DixonJones
Another simple solution is something like:
redirect.php?target=http://domain.com
which then outputs
Location: [domain.com...]
easy enough to do. Search for location redirect and 301 headers together with php and the like on google and you should find it.
SN
I don't understand the second example though. I gather that it will also make the clicks show up as requests in my server logs, but would redirect.php just take $target and refresh to it? kinda the same idea as the inbetween page?
cheers
shasan
Now, when you want statistics about this, look through your logs (probably using a log analyzer) for requests like example.com/redirect/... and you'll have the URLs that you're sending people to.
I've used this before, but I can't find the exact .htaccess file I used. I'm pretty sure that one is close, but you may have to fiddle with it for a few moments.
If you don't run mod_rewrite and don't want to, you can make a mod_perl module like this to do similar:
package Redirect;
sub handler {
my $r = shift;
$r->method('GET');
$r->headers_in->unset('Content-length');
$r->content_type('text/html');
$r->header_out('Location' => $r->path_info() );
return 302;
}
1;
Use it the same way I recommended using mod_rewrite above.
Lastly, I think there is a mod_redirect floating around, but I'm not sure if it's officially supported by the apache.org guys.