Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2003
    Location
    France
    Posts
    44

    One link for downloading a file on multiple servers

    It's for distributing a shareware game.

    I want a a link like http://www.mainwebsite.com/Shareware.zip which dynamically send the download to http://www.secondwebsite.com/dsdsf/Shareware.zip
    or
    http://www.cheapwebsite.com/Shareware.zip
    or
    ...


    The user still see http://www.mainwebsite.com/Shareware.zip , but he download on other servers.

    thanks in advances.
    Web Design, logo, Flash, banner
    Orange Dream Studio
    Free game under the GPL licence:
    Old school game

  2. #2
    Join Date
    Oct 2004
    Location
    UK
    Posts
    487
    Use .htaccess to redirect Shareware.zip to a PHP file which randomly selects one of your servers and starts the download.

  3. #3
    Join Date
    Jan 2005
    Location
    UK
    Posts
    94
    Why not just use a php file to start with like everyone else?

  4. #4
    Join Date
    Nov 2002
    Location
    Finland
    Posts
    96
    Hi,

    you cant do that with php if you want users to see only the www.mainwebsite.com address....

    one really simple loadbalancing solution using mod_rewrite....


    add to httpd.conf or .htaccess

    PHP Code:
    RewriteEngine on
    RewriteMap    server      rnd
    :/path/to/servers.txt
    RewriteRule   
    ^/download/(.+)$ http://${server:server}/download/$1           [P,L] 
    and servers.txt
    PHP Code:
    server location1.com|location2.com|location3.com 
    Not tested but should be ok...


    So what this does is redirect requests to download directory in mainsite to random servers download directory

    CAUTION: DO NOT do not add the mainsite.com to servers.txt, it will cause an endless loop...


    Hope this atleast points you to right direction


    - Tero
    Last edited by t3r0; 05-09-2005 at 07:58 AM.

  5. #5
    Join Date
    Jul 2003
    Location
    France
    Posts
    44
    thanks I will try that.
    Web Design, logo, Flash, banner
    Orange Dream Studio
    Free game under the GPL licence:
    Old school game

  6. #6
    Join Date
    Dec 2004
    Location
    Canada
    Posts
    1,082

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •