...

View Full Version : how i can protect directory ?



marhoons
08-04-2007, 08:43 PM
Hello,
I have login system and i have music folder on my site I want protect this directory to any one want download any thing from this folder and only the members on my login system can be download it and lesten..
so let me explain an exaple:

if we have a directory on my host such as music..

on dir. music we have those file:
1.wma
2.wma
3.wma

and index.php file on this dir. to check the session is set or not i mean the user are logining or not..

so..

how i can colse this way:
any body try download my music file directly from path like:
www.domain.com/music/1.wma

any one have idea for this plan please dont hesitate to tell us about it..

thanks..

ess
08-04-2007, 10:46 PM
There are two ways I can think of.

1- Store all media files in a directory underneath your public_html folder....and use parameters to specify which file that a user wants to download...such as http://yoursite.com/download.php?file=meida1.wma where the download.php file would check user credentials before downloading contents.

2- Use .htaccess mod_rewrite to force all files ending with .wma to forward to a specific page that would check credentials and then allow users to download contents etc.

marhoons
08-10-2007, 08:51 PM
hi again..
thanks alot..
i will try to do it leater on..
if i have qus.

i will come again..

regards
marhoons

matak
08-10-2007, 09:11 PM
or just put index file in your directory with header redirect to your domain

edit: misunderstood.. sry..

use .htaccess



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum