Solved

How to allow access to a specific sub-folder in .htaccess

Posted on 2010-11-23
6
644 Views
Last Modified: 2012-05-10
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
Comment
Question by:Paulclane
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 3

Expert Comment

by:scottbisker
ID: 34202022
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
 

Accepted Solution

by:
Paulclane earned 0 total points
ID: 34204008
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
 
LVL 3

Expert Comment

by:scottbisker
ID: 34205604
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
Industry Leaders: 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!

 

Author Comment

by:Paulclane
ID: 34207525
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
 

Author Comment

by:Paulclane
ID: 34515766
I have moved the default images folder to outside the protected folder, so problem solved.

Thanks for your help!
0
 

Author Closing Comment

by:Paulclane
ID: 34608891
Excellent Help!
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Scroll 5 news at a time. 4 38
Display if field is NOT "" or NOT null 6 22
How to remove a section of the main menu from Magento 1.9.3 3 29
.CSS HTML Help 3 26
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This video teaches users how to migrate an existing Wordpress website to a new domain.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question