• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 657
  • Last Modified:

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?
0
Paulclane
Asked:
Paulclane
  • 4
  • 2
1 Solution
 
scottbiskerCommented:
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.  
0
 
PaulclaneAuthor Commented:
Hi Scott,

I have googled symbolic link and I'm a little confused. This is the path to the current image_uploads folder:

/hsphere/local/home/sitename/sitename.com/admin/image_uploads/

I think that you want me to move the folder to:

 /hsphere/local/home/sitename/sitename.com/

and then run a unix command on the admin folder. Something like this:

ln -s /hsphere/local/home/sitename/sitename.com ./image_uploads

Am I getting close?

 I have Dreamweaver CS3 and Cute FTP Pro.

If I set up this link, will I be able to upload the images into the image_uploads folder, which would now be outside the password protected admin folder, without having to change the path in the uploader?

I'm terrible at web dev/coding, so I really appreciate your help!
0
 
scottbiskerCommented:
Here's what you need to do.

On the server, open up a command shell.

1.  cd /hsphere/local/home/sitename/sitename.com/admin
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
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
PaulclaneAuthor Commented:
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
0
 
PaulclaneAuthor Commented:
I have moved the default images folder to outside the protected folder, so problem solved.

Thanks for your help!
0
 
PaulclaneAuthor Commented:
Excellent Help!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now