Hi,
I have been trying to get this to work for a few hours now. I've searched online and found various methods, but none have worked for me.
Basically, I have a directory that I don't want outside access to (it will have audio download files in it). It is part of a username and password protected directory and I only want logged in users to have access.
The directory I want protection on is:
The referring page I want to allow access from is:
If someone tries to access any of the files in the kit/media_files directory, I want them redirected to kit/index.php.
Here is my latest try, which didn't work. This .htaccess file is in the kit/media_files directory. I also wondered if I should place this code into the main .htaccess file, or should it be in a specific file just for this directory? I tried both and neither work.
If there is a better way to restrict access to this folder to the outside public I'm open to try anything. I just want to make sure only registered users can get into these files.
I have been trying to get this to work for a few hours now. I've searched online and found various methods, but none have worked for me.
Basically, I have a directory that I don't want outside access to (it will have audio download files in it). It is part of a username and password protected directory and I only want logged in users to have access.
The directory I want protection on is:
The referring page I want to allow access from is:
If someone tries to access any of the files in the kit/media_files directory, I want them redirected to kit/index.php.
Here is my latest try, which didn't work. This .htaccess file is in the kit/media_files directory. I also wondered if I should place this code into the main .htaccess file, or should it be in a specific file just for this directory? I tried both and neither work.
Code:
RewriteEngine on RewriteBase / RewriteCond %{HTTP_REFERER} !^http://mysite\.com\.kit/index.php [NC] RewriteCond %{HTTP_REFERER} !^http://www\.mysite\.com\.kit/index.php [NC] RewriteRule ^.*$ http://mysite.com.kit/index.php [R=301,L]
Comment