Paulclane
asked on
How to allow access to a specific sub-folder in .htaccess
Hi guys,
I have a folder on my website called admin, which I protected using .htaccess and it works well. There is a subfolder called "uploaded images" that I need to let anybody access. How do I edit the htaccess file to do this?
I have a folder on my website called admin, which I protected using .htaccess and it works well. There is a subfolder called "uploaded images" that I need to let anybody access. How do I edit the htaccess file to do this?
If the subfolder is inside the admin folder then I don't think you'll be able to do that. If you are a unix box, you could put the images folder up one level and put a symbolic link in the admin folder.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Here's what you need to do.
On the server, open up a command shell.
1. cd /hsphere/local/home/sitena me/sitenam e.com/admi n
2. mv image_uploads ..
3. ln -s ../image_uploads .
First command changes to the correct directory.
Second command moves the image_uploads directory up a level.
Third command puts a symbolic link for the image_uploads directory into the admin directory.
Then when you are using Cute FTP pro, you'll be able to drop images into www.whatever.com/image_uploads
On the server, open up a command shell.
1. cd /hsphere/local/home/sitena
2. mv image_uploads ..
3. ln -s ../image_uploads .
First command changes to the correct directory.
Second command moves the image_uploads directory up a level.
Third command puts a symbolic link for the image_uploads directory into the admin directory.
Then when you are using Cute FTP pro, you'll be able to drop images into www.whatever.com/image_uploads
ASKER
That's a very clear instruction, thank you!.
The reason that I haven't just moved the folder and uploaded images to the moved folder is that the site is a CMS site using TinyMCE. When we upload a product and add images onto the page, it does done using a built-in image uploader, which puts them into the image_uploads folder in admin, so the files will still be uploaded to this folder in admin.
I know I should have mentioned this before, it was a stupid over-sight on my behalf, apologies. I am going to see if I can change the default upload location of the images uploader, evern though I don't have a clue how, but I presume I can just search the .php's until I find the one that mentions image_uploads and edit that
The reason that I haven't just moved the folder and uploaded images to the moved folder is that the site is a CMS site using TinyMCE. When we upload a product and add images onto the page, it does done using a built-in image uploader, which puts them into the image_uploads folder in admin, so the files will still be uploaded to this folder in admin.
I know I should have mentioned this before, it was a stupid over-sight on my behalf, apologies. I am going to see if I can change the default upload location of the images uploader, evern though I don't have a clue how, but I presume I can just search the .php's until I find the one that mentions image_uploads and edit that
ASKER
I have moved the default images folder to outside the protected folder, so problem solved.
Thanks for your help!
Thanks for your help!
ASKER
Excellent Help!