Redirect url compatible with download managers

Status
Not open for further replies.

Nan0

Active Member
65
2011
1
0
Hey guys, I'm working on a custom link shortening, similar to tinyurl. Is made in php
My problem is that I do the redirect does not support download managers.
When I add the short link to any download manager, the long url is not recognized.
This is how I do the redirect:


.htaccess:
PHP:
RewriteEngine On
RewriteRule ^([0-9a-zA-Z]+)$ index.php?id=$1
index.php:
PHP:
<?php
    //$url ; get long url from database based in id
    $url = 'http://www.megaupload.com/?d=H4N9E047';
    header( "HTTP/1.1 302 Found" );
    header( 'Location: '.$url.''  );
    exit;
?>
I've also tried as follows:
index.php:
PHP:
<?php
//$url ; get long url from database based in id
$url = 'http://www.megaupload.com/?d=H4N9E047';
header( "HTTP/1.1 301 Moved Permanently" );
header( 'Location: '.$url.''  );
exit;
?>
any idea?
Thanks for your time.
 
3 comments
Status
Not open for further replies.
Back
Top