Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8078409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:47:04+00:00 2026-06-05T15:47:04+00:00

I have 2 servers. On Server 1 I have a WordPress website. On Server

  • 0

I have 2 servers. On Server 1 I have a WordPress website. On Server 2 I have large .zip files that I want members from the WordPress site to be able to download.

How do I authenticate these users so that only people that are members of the website can download files from the second server?

Is it possible to use PHP so that only referrers from my domain have access to the files?

Note: The links to download the files are protected on the wordpress site so that non-logged in users are redirected to a join page. However, current and ex-members would still know the directory where the downloads are and could possibly download the files or share the links.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:47:05+00:00Added an answer on June 5, 2026 at 3:47 pm

    There are several ways of doing this. The most secure way would be to have some back-end communication between Server 1 & Server 2. But here is an easy alternative:

    Server 2 : download.php

    <?PHP
     $file = $_GET['f'];
     $code = $_GET['c']; 
     $ip = $_SERVER['REMOTE_ADDR'];
    
     if ($code != md5($ip . 'salt')) {
        die('authentication denied');
     }
    
     if(!file)
     {
         die('file not found');
     }
    
     // Set headers
     header("Cache-Control: public");
     header("Content-Description: File Transfer");
     header("Content-Disposition: attachment; filename=$file");
     header("Content-Type: application/zip");
     header("Content-Transfer-Encoding: binary");
    
     // Read the file from disk
     readfile('/files/downloads/' . $file);
    
    ?>
    

    Server 1 : Download link

    <?PHP
     echo '<a href="http://server2.com/download.php?f=text.txt&c=' . md5($_SERVER['REMOTE_ADDR'] . 'salt') / '">Download File</a>';
    ?>
    

    This system works by creating a link that can only be used on the IP it was generated for. So a registered user cannot share the link elsewhere. It’s not the most secure thing but it’s easy to implement and will work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a wordpress website (buddypress plugin/themes). I'm using a plugin that requires access
I have a WordPress driven website and I need to be able to close
I have a wordpress site that is currently running in a subdirectory of my
I have my main website and wordpress in different directories on my server on
I have a server which already host ASP.Net website. I am migrating from blogger
I have been removing our website from wordpress onto its own platform. Temporarily I
I have a website that is running on WordPress. In the document root of
I have a WordPress site with a form that I need to add a
I currently have a single web server hosting multiple WordPress sites which use W3TC.
I have a domain and a wordpress-blog on same server. Now I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.