Solved

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

Posted on 2010-11-23
6
640 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
  • 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now