I have mp3 players set up to play mp3s on my site. The mp3s are all being uploaded to the uploads folder. I don't want people accessing these directly, meaning I don't want people to be able to download the mp3s. Is there a way to somehow restrict access to all files ending in .mp3 in the uploads folder while still having them playable in the mp3 players on the site?
You could do this one of two ways.
1) Simple way. Create a new file in your mp3 directory called index.php, and add this code to it
What this is doing is when a user goes to browse your directory, the web server will serve them the index.php file. Since there is no code in it, the user will be served a blank webpage as a result.
2) Do this through
The Redirect will automatically redirect anyone who tries to access the /mp3/ folder and send them to your main website of mysite.com. The 403 tells the browser that the request is Forbidden.