Page 1 of 1

Protecting content on a different domain?

PostPosted: September 8th, 2010, 2:07 pm
by mackey
Long story short, our site is hosted on 1 domain, while our media is hosted on another. Is it possible to protect our media so only Level2 members can download it?

I looked into multi-site configs but it looked like that was only subdomains. I'm running the latest version of wordpress and s2member pro.

Thanks for your help.

Re: Protecting content on a different domain?

PostPosted: September 9th, 2010, 11:14 am
by Jason Caldwell
Hi there. Thanks for the excellent question.

The short answer is no. You'll need to have all of your protected files inside the /plugins/s2member-files/ directory so that s2Member knows where they are and can protect them from public access.

The long answer is yes, but it depends on where the media is actually hosted
( i.e. externally, or actually on the same server, just under a different domain ).

----------------------------------------

If your media is located on the same server, just under a different domain:
- create a symlink inside the /plugins/s2member-files/ directory that points to the actual location.

From a Unix command line, type in something like this:
Code: Select all
ln -s /actual/path/to/your/files /path/to/plugins/s2member-files/symlink

So now your download links would all look like this:
Code: Select all
http://www.example.com/?s2member_file_download=symlink/file.zip

* NOTE: you will STILL need to protect the real location of your files, by placing an .htaccess inside the real directory they reside in. Just create an empty file named ".htaccess" and put in one line that says:
Code: Select all
deny from all


----------------------------------------

If your media is hosted externally ( on a different server entirely ), then you could look into drive mapping, perhaps using an NFS, which would allow you to map a specific sub-folder on another server over to the /plugins/s2member-files/ directory on your actual site.