Password protect a directory
Autor: Duncan Baker
Visitado 712,
Followers 1,
Compartido 0
I have a locked page which is password protected for members only.
That works fine.
On that page I have links to MP3 files in a subdirectory which I only want members to access.
Running PHP on Linux with Apache.
Grateful for any thoughts.
Duncan
Publicado en
Hello Duncan,
You should be able to do this without going outside WebSite X5. As the members only feature makes use of PHP sessions then the linked MP3 files should be accessible only to logged in users (providing the page that the links are on is locked). This should work... have you tried it and found problems?
The advantage of staying within X5 is that the process can remain dynamic, with users automatically gaining access to the MP3's at the same time as they become members of your site.
However, if you don't mind a more static approach then you could password protect the entire subdirectory using fairly minimal code in an .htaccess file. You would have to add users manually to the .htaccess file as they became members. Let me know if you want further details.
Another alternative would be to compress the MP3 files and password protect them in such a way that a password would be required to extract them. But this would only be easy if the password were the same for all members, and it isn't an option anyway if you want to stream the files as opposed to downloading them.
Just some thoughts for now...
Best regards,
Paul
Autor
Cheers Paul. I'l give that a go.
Duncan